This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| noise() { | |
| local preset="${1}" | |
| echo "playing ${preset} noise..." | |
| case "$preset" in | |
| ocean) | |
| play -q -v 0.3 -n synth brownnoise tremolo 0.19 40 tremolo 0.137 35 tremolo 0.071 30 lowpass 800 | |
| ;; | |
| rain) | |
| play -q -m "|sox -n -p synth brownnoise tremolo 0.41 15 lowpass 900 vol 0.25" "|sox -n -p synth pinknoise tremolo 0.67 20 bandpass 2800 1200 vol 0.08" | |
| ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from sys import argv | |
| def strip_output(nb): | |
| for ws in nb['worksheets']: | |
| for cell in ws['cells']: | |
| if 'outputs' in cell: | |
| cell['outputs'] = [] | |
| if __name__ == '__main__': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LD_LIBRARY_PATH=$HOME/local/lib | |
| k=0 | |
| choices=() | |
| while read line | |
| do | |
| k=$((k+1)) | |
| echo $k "$line" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\path-to-cygwin\bin\mintty.exe -he -l -e /bin/bash -c "PATH=$PATH:/bin/ && /path-to-program/program -z $1" "%1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| strings $1 | sed 's/[^a-zA-Z0-9]/\n/g' | egrep '[a-zA-Z]{5}' | tr '[:upper:]' '[:lower:]' | awk '{++a[$1]}END{for(x in a){print a[x], x}}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Put the CWD in the window title. | |
| function chtt { | |
| echo -en "\033]2;$@\007" | |
| } | |
| export PROMPT_COMMAND='chtt $(pwd)' | |
| # Put the CWD in the window title. | |
| function chtt { | |
| echo -en "\033]2;$@\007" | |
| } | |
| export PROMPT_COMMAND='chtt $(pwd)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xterm*VT100.translations: #override <Key>F1: keymap(x) | |
| xterm*VT100.xKeymap.translations: \ | |
| <Key>F1: keymap(y) \n\ | |
| <Btn4Down>,<Btn4Up>: string("0x1B") string("[M`11") \n\ | |
| <Btn5Down>,<Btn5Up>: string("0x1B") string("[Ma11") \n\ | |
| Ctrl<Btn4Down>,<Btn4Up>: string("0x1B") string("[Mp11") \n\ | |
| Ctrl<Btn5Down>,<Btn5Up>: string("0x1B") string("[Mq11") | |
| xterm*VT100.yKeymap.translations: \ | |
| <Key>F1: keymap(x) \n\ | |
| <Btn4Down>,<Btn4Up>: scroll-back(4,line) \n\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # found at: http://happygiraffe.net/blog/2009/07/04/publishing-a-subdirectory-to-github-pages/ | |
| parent_sha=$(git show-ref -s refs/heads/gh-pages) | |
| doc_sha=$(git ls-tree -d HEAD jslint4java-docs/src/main/resources | awk '{print $3}') | |
| new_commit=$(echo "Auto-update docs." | git commit-tree $doc_sha -p $parent_sha) | |
| git update-ref refs/heads/gh-pages $new_commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| f = fopen('blah','r'); while ~feof(f); line = fgetl(f); eval(line); fflush(stdout); end; fclose(f); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pty' | |
| def till_prompt(cout) | |
| buffer = "" | |
| loop { buffer << cout.getc.chr; break if buffer =~ /octave:.*>/ } | |
| return buffer | |
| end | |
| def octave(string) | |
| @octave_in.printf("#{string}\n") |
NewerOlder