Skip to content

Instantly share code, notes, and snippets.

View saml's full-sized avatar

Sam Lee saml

  • New York, NY
View GitHub Profile
@saml
saml / compressor.ny
Created December 6, 2011 04:09
Chris's Dynamic Compressor
;nyquist plug-in
;version 1
;type process
;categories "http://lv2plug.in/ns/lv2core#CompressorPlugin"
;name "Compress &dynamics 1.2.6..."
;action "Compressing..."
;info "Does dynamic (volume) compression with lookahead.\n'Compress ratio' is how much compression to apply. Raise when soft parts\n are too soft, and lower to keep some dynamic range. You can soften the\n soft parts instead of increasing them with values < 0, and invert\n loudness with values > 1 (lower max amp when you do).\n'Hardness' is how agressively to compress. Raise when parts are still\n hard to hear (even with a high compress ratio). Lower when the result\n sounds distorted.\nRaise 'floor' to make quiet parts stay quiet.\nRaise 'noise gate falloff' to make quiet parts (beneath 'floor') disappear.\nLower 'maximum amplitude' if you experience clipping."
;control compress-ratio "Compress ratio" real "" .5 -.5 1.25
;; TO ENABLE ADVANCED SETTINGS: delete one semicolon from the beginning of the next two lines, then add one to following fo
<%--
runs xpath
--%><%@page
language="java"
contentType="text/plain; charset=UTF-8"
pageEncoding="UTF-8"
import="javax.jcr.query.*,
java.io.*,
java.util.*,
java.util.regex.*,
@saml
saml / ats_practice.dats
Created December 15, 2011 05:16
ats practice
val f = lam(x:double):double => x*x
fn g(x:double):double = x/x
fun fib(n:int):int =
if (n <= 0) then
0
else if (1 = n) then
1
else
fib(n - 1) + fib(n - 2)
@saml
saml / cqapi.py
Created December 22, 2011 18:06
cq api
'''CQ HTTP API
>>> cq = CQCurl(curl='curl', host='localhost', port=4502, cookie_path='/tmp/tmp.cookie')
>>> cq.url('/foo/bar')
'http://localhost:4502/foo/bar'
#>>> cq.login(dryrun=True)
#curl -f -s -F _charset_=utf-8 -c /tmp/tmp.cookie -F j_username=admin -F j_password=admin http://localhost:4502/libs/qa/core/content/login.html/j_security_check
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 path-to-add"
exit 1
fi
abspath="$(dirname "$1")/$(basename "$1")"
relpath="${abspath##$HOME}"
@saml
saml / gmailexists.sh
Created March 31, 2012 20:39
gmail exists
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 username"
exit 1
fi
username="$1"
json_left='{"input01":{"Input":"GmailAddress","GmailAddress":"'
@saml
saml / gist:2364270
Created April 12, 2012 02:09
twistedweb twistd web server
#!/bin/bash
if (( $# < 1 ))
then
echo "Usage: $0 htdocs [other params]"
exit 1
fi
htdocs="$1"
shift 1
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<!-- DEFAULT VARIABLES -->
<meta name="color:Background" content="#000" />
<meta name="color:PostBg" content="" />
<meta name="color:Post" content="#e8f1e8" />
<meta name="color:PostTitle" content="#b5e853" />
<meta name="color:PostA" content="#00c9ff" />
<meta name="color:PostFooterBg" content="" />
@saml
saml / urls.txt
Created May 24, 2012 03:19
vlt sync cq5 crap
http://bpaste.net/show/zDKaQZ7JZ8nLxqsyNW5s/
http://bpaste.net/show/2JFuadtSGb5xash7ojxm/
<maestrojed> saml did you get it figured out>
* pingu9 has quit (Ping timeout: 244 seconds)
<saml> maestrojed, no.. to me, 100x100 pixel image is 100x100 pixel everywhere.. it might appear smaller or larger depending on display's dpi
<maestrojed> saml one dot does equal one pixel. Its about how many dots or pixels fit in one inch.
<saml> yah .. i think we're saying the same thing
<maestrojed> saml we are not
<maestrojed> an image is encoded in pixels and dip
<maestrojed> dpi
<saml> 100x100 pixel is 100x100 pixel
<oojacoboo> dpi = printing