Skip to content

Instantly share code, notes, and snippets.

View chrismanderson's full-sized avatar

Chris Anderson chrismanderson

View GitHub Profile
# Colors from http://wiki.archlinux.org/index.php/Color_Bash_Prompt
# misc
NO_COLOR='\e[0m' #disable any colors
# regular colors
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
MAGENTA='\e[0;35m'
@chrismanderson
chrismanderson / gist:4684683
Created January 31, 2013 17:39
dtruss hello world output
→ dtruss ruby -e puts 'hello, world'
ruby: no -e allowed while running setuid (SecurityError)
SYSCALL(args) = return
issetugid(0x10CD52000, 0x5, 0x7FFF52EAD500) = 0 0
geteuid(0x10CD52000, 0x5, 0x0) = 0 0
csops(0x0, 0x0, 0x7FFF52EACFD4) = 0 0
shared_region_check_np(0x7FFF52EAAF28, 0x2, 0x7FFF52EAAF28) = 0 0
stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF52EAC070, 0x7FFF52EAD040 = 0 0
open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0) = 3 0
pread(0x3, "\312\376\272\276\0", 0x1000, 0x0) = 4096 0
function rbenv_prompt_info() {
local ruby_version
ruby_version=$(rbenv version 2> /dev/null) || return
echo "$ruby_version" | sed 's/[ \t].*$//'
}
alias rvm-prompt=rbenv_prompt_info
alias rvm_prompt_info=rbenv_prompt_info
function rbenv_prompt_info() {
local ruby_version
ruby_version=$(rbenv version 2> /dev/null) || return
echo "$ruby_version" | sed 's/[ \t].*$//'
}
alias rvm-prompt=rbenv_prompt_info
alias rvm_prompt_info=rbenv_prompt_info
export PS1="\n$RED\$(rbenv_prompt_info) $GREEN\w$EWHITE\$(vcprompt)$OFF \n→ "
[ 1068.087883] We welcome our new Lua overlords!
[ 1068.089710] Lua from fib.lua:10946
[ 1068.108374] Lua string is
[ 1068.108379] garbage 2816
[ 1068.108383] garbage 2816
[ 1068.130169] Lua string is
[ 1068.130174] garbage 4893
[ 1068.130178] garbage 4893
[ 1068.152191] Lua string is
[ 1068.152196] garbage 2816
@chrismanderson
chrismanderson / thrift
Created October 5, 2013 00:01
thrift mavericks stack trace
→ cat /Users/chris/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/thrift-0.9.1/ext/gem_make.out
/Users/chris/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
checking for strlcpy() in string.h... yes
creating Makefile
make
compiling binary_protocol_accelerated.c
compiling bytes.c
compiling compact_protocol.c
int GetInt(void)
{
// try to get an int from user
while (true)
{
// get line of text, returning INT_MAX on failure
string line = GetString();
if (line == NULL)
{
return INT_MAX;
@chrismanderson
chrismanderson / foo.jsonp
Last active August 29, 2015 14:09 — forked from tmcw/foo.jsonp
d3.jsonp.foo('Hello, World!');

Input JSON:

{
   "fleet":{
      "MVVSYUagG6":{
         "shift-end":"9:00",
         "shift-start":"0:00",
         "start-location":"depot"
      },

"LC0Ux5hmUR":{