Skip to content

Instantly share code, notes, and snippets.

@lennart
lennart / aliases
Created June 3, 2015 11:05
Bash Alias for converting rgb values to hex, Usage: rgb2hex 12 245 14
alias rgb2hex='printf "#%02x%02x%02x\n"'
@lennart
lennart / jquery.selectbox.js
Created March 10, 2011 13:41
jQuery SelectBox plugin, with _slight_ modifications
/**
* jQuery Selectbox plugin 0.1
*
* Copyright 2011, Dimitar Ivanov (http://www.bulgaria-web-developers.com/projects/javascript/selectbox/)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function ($, undefined) {
var PROP_NAME = 'selectbox',
FALSE = false,
TRUE = true;
@lennart
lennart / kick_manual.sh
Created May 20, 2020 18:41
manual kick script (stock axiom beta firmware)
#!/bin/bash
cd "${0%/*}" # change into script dir
. ./cmv.func
. ./hdmi.func
. ./i2c0.func
./fclk_init.sh
./zynq_info.sh
@lennart
lennart / capistrano-deploy-and-rollback.log
Last active March 27, 2020 13:31
Log of a deploy and rollback with multiple asset manifests
# Logfile created on 2020-03-27 14:25:53 +0100 by logger.rb/66358
INFO ---------------------------------------------------------------------------
INFO START 2020-03-27 14:25:53 +0100 cap staging deploy
INFO ---------------------------------------------------------------------------
DEBUG [9303ea55] Running /usr/bin/env which passenger as user@staging.example.com
DEBUG [9303ea55] Command: /usr/bin/env which passenger
DEBUG [9303ea55] Finished in 0.381 seconds with exit status 1 (failed).
DEBUG [34ddfb7b] Running ~/.rvm/bin/rvm version as user@staging.example.com
DEBUG [34ddfb7b] Command: ~/.rvm/bin/rvm version
DEBUG [34ddfb7b] rvm 1.29.7-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
@lennart
lennart / miteinander_map.rb
Created March 18, 2020 14:26
simplify location lookup (pseudo-implementation)
require 'json'
GRID_STEP_SIZE = 100 # meters
# https://stackoverflow.com/questions/12966638/how-to-calculate-the-distance-between-two-gps-coordinates-without-using-google-m
def distance(loc1, loc2)
rad_per_deg = Math::PI/180 # PI / 180
rkm = 6371 # Earth radius in kilometers
rm = rkm * 1000 # Radius in meters
@lennart
lennart / README.md
Last active June 24, 2019 19:11
Splended, a simple Sampler Builder based on Blender… It is, though, just a script.

splended

Build musical samplers with blender, splended helps you!

Installation

OS X

put splended.py into ~/Application Support/Blender/2.xx/scripts/

[
{
"caption": "SublimeREPL: Tidal",
"command": "run_existing_window_command", "args":
{
"id": "repl_tidal",
"file": "config/Tidal/Main.sublime-menu"
}
}
]
@lennart
lennart / lvbootstrap
Last active October 30, 2016 00:12
diy shell script explanation of base image creation to run systemd-nspawn containers from btrfs subvolumes
#!/bin/sh
log=3
fence="s/.*/ &/"
echo "# How to make a new base image"
echo "for containers."
echo
echo "Create a new logical volume:"
echo
lvcreate --help 2> /dev/null | head -n $log | sed "$fence"
@lennart
lennart / eruby-coffee.vim
Created April 21, 2011 14:11
Coffee Script in ERB
autocmd BufNewFile,BufRead *.erb set filetype=eruby-coffee
d1 $ n (weave' 8 (run 4) [
rev . slow 2 . offadd 0.25 12,
slow 4 . offadd 0.5 7,
iter 4
]) # s "supercomparator"