Skip to content

Instantly share code, notes, and snippets.

//RewriteCond %{REQUEST_URI} !^/index\.php.* [NC]
//RewriteRule ^(.*)$ /index.php
//RewriteCond %{REQUEST_URI} ^/site [NC]
//RewriteRule site index.php
if ( isset($_SERVER['REDIRECT_URL']) ) {
// REDIRECT_URL - PHP_SELF
// http://localhost/test/ym/something/or/other?woot=1
@jsawruk
jsawruk / pitchClassNormalForm.py
Created September 22, 2012 15:37
Compute the pitch class normal form of a pitch class set
def rangeDiff(pcs):
# Return the difference between the first and last items of a list of pitch class sets
diff = (pcs[len(pcs) - 1] - pcs[0])
if diff < 0:
diff += 12
return diff
def cycleLeft(pcs):
# Return a single cyclic left permutation of a pitch class set
# Ex: [a,b,c] -> [b, c, a]
@jsawruk
jsawruk / Compressor.as
Created September 17, 2012 12:46
Audio Compressor (Actionscript)
package
{
import flash.utils.ByteArray;
public class Compressor
{
private var attackTime:Number = 0.001;
private var releaseTime:Number = 0.130;
private var slope:Number = 0.5;
private var thresh:Number = -0.1;