This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Auto-unlock wrapper for larger operations | |
/* | |
Exmaple usage: | |
struct MyStruct { | |
PtrLock<decltype(m_value)> getValues() | |
{ | |
return PtrLock<decltype(m_value)>(m_lock, &m_value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <stdint.h> | |
#include <vector> | |
#include "vector3d.h" | |
using u8 = unsigned char; | |
using s16 = int16_t; | |
using u16 = uint16_t; | |
using v3s16 = irr::core::vector3d<s16>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ft = {} | |
ft.__index = ft | |
function FSTile(w, h) | |
local self = {} | |
setmetatable(self, ft) | |
-- init stuff here | |
self.containers = {} | |
self.width = w | |
self.height = h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd irrlicht | |
# Fake installation dir | |
mkdir -p __output/include | |
mkdir -p __output/lib/cmake/IrrlichtMt | |
ln -sf ../../include __output/include/irrlichtmt | |
cp -f IrrlichtMt*.cmake __output/lib/cmake/IrrlichtMt/ | |
cp -fP lib/Linux/libIrrlichtMt* __output/lib/ | |
cp -fr CMakeFiles/Export/lib/cmake __output/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Filter Rules | |
============== | |
Works for: | |
- AdblockPlus | |
- ublock origin | |
- ?? | |
Group by: Repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minetest.register_privilege( "lava", "Can place lava at any depth.") | |
local LAVA_PLACE_DEPTH = -50 | |
function override_on_place(item_name) | |
local def = minetest.registered_items[item_name] | |
local old_on_place = def.on_place | |
def.on_place = function(itemstack, placer, pointed_thing) | |
if pointed_thing.type ~= "node" then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
remote="upstream" | |
url=$(LANG=C git remote -v get-url $remote 2>&1) | |
if [[ $url == fatal* || $url == error* ]]; then | |
remote="origin" | |
url=$(LANG=C git remote -v get-url $remote 2>&1) | |
fi | |
if [[ $url == fatal* || $url == error* ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example structure | |
┌─── NeuralLayer 1 ────┐ | |
│ Inputs (source data) │ | |
│ Outputs (1) │ | |
└─────vvvvvvvvvvvv─────┘ | |
┌─── NeuralLayer 2 ────┐ | |
│ Inputs = Outputs (1) │ | |
│ Outputs (2) │ | |
└─────vvvvvvvvvvvv─────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Minetest Lua mod to have a rudimentary display of the biomes in your world | |
-- CC0, Written by Krock/SmallJoker 2019 | |
-- Sample image: https://krock-works.uk.to/u/ethereal_cc57167_ASCII_map.png | |
local STEPSIZE = 32 | |
local X_RADIUS = 1000 | |
local Z_RADIUS = 1000 | |
local CHARACTERS = { | |
"x", ".", "+", "@", "#", | |
"▨", "□", "■", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ vectortest.cpp | |
/* | |
emplace_back: 553305 ticks | |
push_back: 665359 ticks | |
resize: 437487 ticks | |
*/ | |
// g++ -O3 -ffast-math vectortest.cpp | |
/* | |
emplace_back: 165961 ticks | |
push_back: 165695 ticks |
NewerOlder