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
| for var in "$@" | |
| do | |
| echo $var | |
| done |
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
| TMP_FILE=$(mktemp) | |
| for var in "$@" | |
| do | |
| echo $var >> $TMP_FILE | |
| done | |
| GNUPLOT_FILE=$(mktemp) | |
| gnuplot <<DeadBeef | |
| set style line 1 linetype 2 |
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 | |
| echo $(find . -type f | grep -v .git | wc -l) |
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 | |
| if [ $# -lt 3 ]; then | |
| echo "Usage: <mode> <github username> <gist filename>" >&2 | |
| echo " mode is:" >&2 | |
| echo " -o output the file to stdout" >&2 | |
| echo " -s store the file in a temporary location, and print the temp filename" >&2 | |
| echo " -x execute the script" >&2 | |
| echo " (to pass arguments to the downloaeded script, add a \"-\" and add" >&2 | |
| echo " add the args for the downloaded script after that)" >&2 |
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
| λ ~ → echo 'echo $1 $2 $3' | bash -s - 10 11 12 | |
| 10 11 12 |
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 | |
| if ! [ -d ".git" ]; then | |
| echo "Script must be run from within a git repository" | |
| exit 1 | |
| fi | |
| if [ $# -ne 1 ]; then | |
| echo "Please specify a script to execute for each commit" | |
| echo "Script will recieve <repo_dir> <commit ref> as arguments" |
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
| var Inotify = require('inotify').Inotify; | |
| var inotify = new Inotify(); //persistent by default, new Inotify(false) //no persistent | |
| var data = {}; //used to correlate two events | |
| var callback = function(event) { | |
| var mask = event.mask; | |
| var type = mask & Inotify.IN_ISDIR ? 'directory ' : 'file '; | |
| event.name ? type += ' ' + event.name + ' ': ' '; |
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
| for F in `find . -executable`; do ./$F -r 4 > tmp.pov; povray +O$F.png +A0.5 +AM2 +W1600 +H1200 tmp.pov; done |
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
| var NotAuthenticated = function () { | |
| this.name = "Not authenticated"; | |
| Error.call(this, "Not authenticated"); | |
| Error.captureStackTrace(this, arguments.callee); | |
| }; | |
| NotAuthenticated.prototype.__proto__ = Error.prototype; | |
| ... later on .... | |
| if (error instanceof NotAuthenticated) { |
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 calendar | |
| import sys | |
| def ConvertDays(days): | |
| year = 1980 | |
| while days > 365: | |
| if calendar.isleap(year): | |
| if days > 366: | |
| days -= 366 | |
| year += 1 |