Skip to content

Instantly share code, notes, and snippets.

View coderofsalvation's full-sized avatar

Coder of Salvation / Leon van Kammen coderofsalvation

View GitHub Profile
@coderofsalvation
coderofsalvation / gist:1916306
Created February 26, 2012 11:58
samplescan.sh - converts directories with audiosamples into symbolically linked trees sorted on harmonic key/scale
#!/bin/bash
#
# Samplescan - scans directories with wav-files on harmonic content
#
# (By determining the keys, and a symbolically linked directory structure)
#
# pre-requisites: vamp-plugin-sdk package (http://www.vamp-plugins.org)
#
###########################################################################
#
@coderofsalvation
coderofsalvation / xdebug
Last active October 1, 2015 04:08
xdebug - a cmdline utility to trigger php xdebugging (settings) and to easify automated, multi-user profiling and tracing.
#!/bin/bash
#
# XDEBUG.sh : a cmdline utility to test xdebug settings,
# and to easify automated, multi-user profiling,debugging and tracing in live-environments
#
# Copyright 2012, Leon van Kammen (Coder of Salvation), All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
@coderofsalvation
coderofsalvation / playterm
Created May 24, 2012 07:35
playterm - a console utility to upload/record playterm.org recordings (wrapper around ttyrec)
#!/bin/bash
#
# Author: Coder of Salvation /Leon van Kammen
# Website: www.playterm.org
# Date: 2012-05-15
# Function: console frontend to playterm.org (wrapper around ttyrec)
#
# Copyright (C) 2012, Coder of Salvation / Leon van Kammen
#
# This program is free software: you can redistribute it and/or modify
@coderofsalvation
coderofsalvation / recbox
Created June 19, 2012 12:38
Recbox - record and replay PHP requests (Great for testing SaaS-applications on devservers with livedata)
<?
/**
* File: recbox.php
* Date: Tue 19 Jun 2012 01:31:59 PM CEST
*
* records/replays php requests.
*
* PROBLEM: big SaaS-applications are like a racecar running 200kmph nonstop.
* Usually developers add new features on a developmentserver, to test them.
* Then..eventually it needs to be integrated on the liveserver (fingerscrossed).
@coderofsalvation
coderofsalvation / winetalk
Created July 5, 2012 11:52
winetalk - named pipes for communication between wine and linux bash
# setup named pipes for wine<->linux shell communication
#
# APPLICATIONS: glue linux & wine, use linux in .bat scripts, system() C-calls etc
# USAGE:
#
# [linux]
# mkfifo /tmp/wine_in
# mkfifo /tmp/wine_out
# ./winetalk /tmp/wine_in /tmp/wine_out
#
@coderofsalvation
coderofsalvation / wavdir2sfz
Created July 12, 2012 11:25
wavdir2sfz - create sfz soundfonts from directory containing wav audiofiles with notes in their filenames
#!/bin/bash
# Copyright 2012, Leon van Kammen (Coder of Salvation), All rights reserved.
#
# Native instrument comes with a huge library of sounds (The Maschine Library) for Maschine.
# Wouldnt it be nice if non-maschine owners can use these instruments?
# Lot of times when I see multisamples in directories, I'd like to have an .sfz soundfont for them
# (instead of playing it with some kind of massivegui vst/pluginplayer).
# A typical directory could look like :
#
# Samples/Instrument/Bass1/Bass1 c1.wav
@coderofsalvation
coderofsalvation / sql2dot
Created July 24, 2012 11:31
sql2dot - converts sqldumps to graphiz, in order to render an image showing sql-table & relations
#!/bin/bash
# Copyright 2012, Leon van Kammen (Coder of Salvation), All rights reserved.
#
# this utility can generate database table images from sql-files.
# It converts sqldump into graphviz layout (dot) format.
# Once having a graphviz file, you can convert it to many image formats (svg/png) or view it
# interactively using canviz.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
@coderofsalvation
coderofsalvation / cachesamples.sh
Last active April 18, 2019 11:16
samplesort - converts audiosample-directories into symbolically linked trees sorted on tags (kick/hihat/etc)
#!/bin/sh
#
# this will build a database using the 'mlocate' package (see debian/ubuntu etc)
# make sure to set 'export LOCATE_PATH="/path/to/mlocate.db"' when using 'locate'
renice +19 -p $$ >/dev/null 2>&1
ionice -c2 -n7 -p $$ >/dev/null 2>&1
/usr/bin/updatedb --output /path/to/mlocate.db --local-path -U /path/to/your/samples
@coderofsalvation
coderofsalvation / Skeleton PHP CLI-cmd (robust)
Created August 7, 2012 09:12
Skeleton PHP CLI-cmd (robust)
#!/usr/bin/env php
<?php
/*
* cli skeleton - starting point for cli/web-command with interaction,options,manual,dependancies and colors
* (needs chmod 755 for cli)
* (ROBUST VERSION)
*
* cheers, Coder of Salvation 2012 (http://leon.vankammen.eu)
*/
@coderofsalvation
coderofsalvation / cli-skeleton-minimal.php
Last active October 8, 2015 05:18
PHP CLI-cmd (minimal)
#!/usr/bin/env php
<?php
/*
* cli skeleton - starting point for cli-command
* (needs chmod 755 for cli)
* (MINIMAL VERSION)
*/
$args = array();