Skip to content

Instantly share code, notes, and snippets.

#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum layer_names {
_BL,
_FL
};
@benvh
benvh / auto-sync.sh
Created August 12, 2016 06:17
auto rsync through inotify
cloud_dir=/path/to/dir
remote_host=somehost
remote_dir=cloud
while [[ true ]]; do
inotifywait -q $cloud_dir
rsync -av $cloud_dir $remote_host:$remote_dir
done
@benvh
benvh / location.js
Created June 6, 2015 12:54
LocationWatcher
function LocationWatcher() {
var self = this;
self.watcherId = undefined;
self.location = { long: 0, lat: 0 };
self.startWatching = startWatching;
self.stopWatching = stopWatching;
'use strict';
var Vector2 = require('./math/vector2');
var Engine = require('./core/engine');
var Renderer = require('./modules/renderer');
var LevelLoader = require('./modules/level-loader');
var GameObject = require('./core/game-object');
'use strict';
//e = f/a
//b² = a * √(1 - e²)
//f² = a² - b²
var Component = require('../core/component');
var Vector2 = require('../math/vector2');
@benvh
benvh / promises.js
Created May 30, 2015 15:13
simple promise implementation
'use strict';
module.exports = {
Promise: Promise,
Deferred: Deferred
};
var noop = function(value){ return value; };
@benvh
benvh / sabnzbd.sh
Last active December 11, 2015 18:38
SABnzbd init.d script for debian
#! /bin/bash
### BEGIN INIT INFO
# Provides: sabnzbd
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of SABnzbd
# Description: starts instance of SABnzbd using start-stop-daemon