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
#!/usr/bin/env bash | |
# "xdg-grep" script for $HOME/.local/bin/ | |
set -e | |
if [ -z "$1" ]; then | |
echo "Missing keyword" | |
exit 0 | |
fi |
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 <set> | |
#include <stdexcept> // std::runtime_error | |
#include <stdio.h> | |
#define DO_ERROR() do { throw std::runtime_error("fault"); } while(0) | |
class PtrAutoNullOMatic { | |
public: | |
PtrAutoNullOMatic() = default; | |
~PtrAutoNullOMatic() |
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─────┘ |
NewerOlder