Skip to content

Instantly share code, notes, and snippets.

View jrk's full-sized avatar

Jonathan Ragan-Kelley jrk

View GitHub Profile
@jrk
jrk / Test.md
Created September 29, 2011 03:56

Test

@jrk
jrk / welcome.md
Created September 29, 2011 03:55

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@jrk
jrk / bootstrap.log
Created May 20, 2011 23:11
GODI Homebrew install errors
Using PATH=/usr/local/Cellar/godi/3.12/bin:/usr/local/Cellar/godi/3.12/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/narwhal/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Users/jrk/.cabal/bin:/Users/jrk/bin:/usr/local/cuda/bin:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/local/share/npm/bin:/usr/local/sbin:/Applications/Pixar/RenderMan.app/Versions/RenderManProServer-14.3/bin:/usr/local/bin:/usr/X11R6/bin:/Applications/Matlab/bin:/Developer/Tools:/Users/jrk/Projects/PFC/bin:/usr/local/Cellar/depot_tools/CURRENT:/Users/jrk/.rvm/bin:/Users/jrk/.rip/active/bin:/usr/local/Library/Contributions/examples
./configure -no-curses -no-shared-libs -no-pthread
cd byterun; /usr/bin/make libcamlrun.a
Makefile:16: ../config/Makefile: No such file or directory
make[1]: *** No rule to make target `../config/Makefile'. Stop.
make: *** [build] Error 2
make: *** Waiting for unfinished jobs....
Confi
@jrk
jrk / gist:819409
Created February 9, 2011 22:05
Install matlab-ruby against Mac MATLAB.app install
# http://www.macresearch.org/matlab-ruby-snow-leopard
# Build/install
sudo env ARCHFLAGS="-arch x86_64" gem install matlab-ruby -- --with-matlab-include=/Applications/MATLAB_R2010b.app/extern/include --with-matlab-lib=/Applications/MATLAB_R2010b.app/bin/maci64 --with-swig
# Run irb
PATH=/Applications/MATLAB_R2010b.app/bin:$PATH DYLD_LIBRARY_PATH=/Applications/MATLAB_R2010.app/sys/os/maci64:/Applications/MATLAB_R2010b.app/bin/maci64/MATLAB.app/Contents/MacOS:/Applications/MATLAB_R2010b.app/bin/maci64:/Applications/MATLAB_R2010b.app/extern/lib/maci64:/Applications/MATLAB_R2010b.app/runtime/maci64 irb

To reproduce

  • Create or link a large (10s of MB) binary file to /tmp/big.zip.

  • Run

  • Fetch the data with curl:

    curl -O http://localhost:8080

==> fails in chunky parser at random points during download

<a href="javascript:var%20http%20=%20new%20XMLHttpRequest();var%20url%20=%20%22https://prowl.weks.net/publicapi/add%22;var%20apikey%20=%20%qqqqqq%22;var%20application%20=%20%22the%20web%22;var%20evt%20=%20%22Browser!%22;var%20description%20=%20encodeURIComponent(document.title.replace(/^\s*|\s*$/g,%27%27))+%20escape(%22\n%22)%20+%20encodeURIComponent(location.href);var%20params%20=%20%22apikey=%22+apikey+%22&application=%22+escape(application)+%22&event=%22+escape(evt)+%22&description=%22+description;http.open(%22POST%22,%20url,%20true);http.setRequestHeader(%22Content-type%22,%20%22application/x-www-form-urlencoded%22);http.send(params);">Prowl!</a>
(Replace "qqqqqq" in the bookmarklet string with your Prowl <a href="https://prowl.weks.net/settings.php">API key</a> before using.)
@jrk
jrk / gist:316073
Created February 26, 2010 19:44
Wrapper to run R scripts like Python/Perl/Ruby/Bash/anything else sane
#!/bin/sh
# Wrapper to easily run an R script at the command line, with arguments,
# like you're used to with Python/Perl/Ruby/Bash/anything else remotely sane.
#
# Usage:
# runR <script.R> [argument list]
# you can also optionally route output to /dev/null, depending on your desires
R --vanilla "--args ${@:2}" < $1 #>/dev/null
@jrk
jrk / gist:295178
Created February 4, 2010 22:09
Open a new OS X Terminal window at an arbitrary path from Bash.
function openterm {
## Open a new Terminal window at $1
path=`cd $1; pwd`
osascript -e "tell application \"Terminal\" to do script \"cd ${path}\""
}
@jrk
jrk / redis-server-for-init.d-startup
Created January 25, 2010 17:00 — forked from mtodd/redis-server-for-init.d-startup
init.d script for redis server
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db