Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivo Wetzel BonsaiDen

View GitHub Profile
View land.ks
FUNCTION descent_math {
PARAMETER radar_offset.
PARAMETER target_height.
LOCAL descent_rate TO -SHIP:VERTICALSPEED.
LOCAL clearance TO MAX(ALT:RADAR - radar_offset - target_height, 0).
// Work out centripetal acceleration (i.e. an upward acceleration component
// due to the planet curving away from us)
View drive_to.ks
DECLARE PARAMETER waypointName.
DECLARE PARAMETER withinRadius.
SET w TO WAYPOINT(waypointName).
print("--- ROVER DRIVE TO PROGRAM ---").
print("[INFO] Waypoint: " + waypointName).
print("[INFO] Distance: " + w:GEOPOSITION:DISTANCE + "m").
print("[INFO] ETA: " + w:GEOPOSITION:DISTANCE / 4.0 + "s").
View user.js
// ==UserScript==
// @name AntiNintendoSpoiler
// @namespace foobar
// @include https://www.youtube.com/*
// @version 1
// @grant none
// ==/UserScript==
var originalOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
@BonsaiDen
BonsaiDen / code.rs
Created Apr 14, 2016
rustfmt results
View code.rs
// Before ---------------------------------------------------------------------
self.delay_until_good_mode = cmp::min(
self.delay_until_good_mode,
MAX_GOOD_MODE_TIME_DELAY
);
// After ----------------------------------------------------------------------
self.delay_until_good_mode = cmp::min(self.delay_until_good_mode,
MAX_GOOD_MODE_TIME_DELAY);
View ubuntu-mate.md

Mate Desktop:

sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install --no-install-recommends ubuntu-mate-core ubuntu-mate-desktop

Light DM Greeter

sudo dpkg-reconfigure lightdm
@BonsaiDen
BonsaiDen / racer.vim
Last active Sep 9, 2015
Patched racer.vim
View racer.vim
" Vim plugin for Racer
" (by Phil Dawes)
"
" 1. Edit the variables below (or override in .vimrc)
" 2. copy this file into .vim/plugin/
" 3. - now in insert mode do 'C-x C-o' to autocomplete the thing at the cursor
" - in normal mode do 'gd' to go to definition
"
" (This plugin is best used with the 'hidden' option enabled so that switching buffers doesn't force you to save)
@BonsaiDen
BonsaiDen / record.sh
Last active Jul 31, 2021
Record from Virtual Frame Buffer via ffmpeg
View record.sh
xvfb-run -s "-screen 0 1280x800x16" -e /dev/stdout -a /home/ivo/Desktop/foo.sh
./ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1280x800 -i :99 -c:v libvpx -quality realtime -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an screen.webm
# foo.sh
google-chrome --incognito --window-size=1280,800 --app=http://github.com
@BonsaiDen
BonsaiDen / substrat2.js
Created Mar 6, 2015
Ideas for Substrat 2
View substrat2.js
// Disable compress and concat filters, this turns them into forwarders
sub.disable('compress').disabled('concat');
// filter takes but keeps, reduced takes and removes
var libs = sub.reduce(/lib\/.*\.js$/).compress().concat(),
config = sub.reduce('js/global.js').compile(sub.mustache()),
app = config.merge(sub.reduce([
View .jshintrc
{
"predef": [ "-Promise" ],
// JShint
"passfail" : false, // if the scan should stop on first error
// Tolerate features
"eqnull" : false, // if == null comparisons should be tolerated
"sub" : true, // if all forms of subscript notation are tolerated
"asi" : false, // if automatic semicolon insertion should be tolerated
@BonsaiDen
BonsaiDen / starfield.glsl
Last active May 28, 2017
WebGL Starfield Shader for THREE.js
View starfield.glsl
uniform vec2 resolution;
uniform float time;
vec3 mod289(vec3 x) {
return x - floor(x * (1.0 / 239.0)) * 239.0;
}
vec2 mod289(vec2 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}