Skip to content

Instantly share code, notes, and snippets.

View bronson's full-sized avatar

Scott Bronson bronson

  • Santa Cruz, CA
View GitHub Profile
@bronson
bronson / gist:1040671
Created June 22, 2011 17:52
git checkout v2.0.beta.1 && diff -ub sproutcore-2.0.beta.1.js tmp/sproutcore.js
--- sproutcore-2.0.beta.1.js 2011-06-22 10:48:40.000000000 -0700
+++ /home/bronson/sc2/sproutcore20/tmp/sproutcore.js 2011-06-22 10:45:02.000000000 -0700
@@ -2303,839 +2303,629 @@
-var USE_ACCESSORS = SC.USE_ACCESSORS;
-var GUID_KEY = SC.GUID_KEY;
-var META_KEY = SC.META_KEY;
-var meta = SC.meta;
~/sc2/sproutcore20$ cat .git/HEAD
a1564cd5a554f14f451c83671e3084be0cf54e16
~/sc2/sproutcore20$ git status
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
~/sc2/sproutcore20$ git describe --tags
v2.0.beta.1
~/sc2/sproutcore20$ git status
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: packages/sproutcore-metal/lib/watching.js
#
@bronson
bronson / gist:1043190
Created June 23, 2011 18:24
Listing Git tags by date
Why does it have to be this hard?
$ git for-each-ref --sort='*authordate' --format='%(tag)%09%(*authordate)' refs/tags
0.2 Wed Oct 27 22:48:10 2010 -0700
0.3 Fri Oct 29 13:06:48 2010 -0700
0.3.1 Sat Oct 30 13:00:42 2010 -0700
0.4.0 Sun Mar 6 18:10:43 2011 -0800
http://nickol.as/post/5838704298/git-tags-by-date
@bronson
bronson / gist:1053164
Created June 29, 2011 04:37
Installing Vim from source on Ubuntu to fix crashing
# The vim included with Ubuntu Natty is heinously buggy. Also Lucid it appears.
# Fix that by compiling the latest Vim 7.3 yourself:
sudo dpkg --purge vim-runtime vim-gui-common vim-gtk vim-gnome vim-nox
cd vim/src
sudo apt-get install mercurial libgnome2-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev libperl-dev python-dev ruby-dev
hg clone https://vim.googlecode.com/hg/ vim
rvm use system # (if you're using rvm)
./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope --with-features=huge --enable-gui=gnome2 --with-x
make -j 3 # 3 jobs in parallel, 1 more than # of cores
@bronson
bronson / .vimrc
Created July 9, 2011 02:57
difference between Pathogen and Vundle?
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" enabling this fixes things:
"call pathogen#runtime_append_all_bundles()
filetype indent plugin on
@bronson
bronson / gist:1214062
Created September 13, 2011 15:11
which is the nicer validation syntax?
// What's the best syntax to validate a JSON object?
var addr = { NamePrefixText: "Dr.", FirstName: "Lex", LastName: "Luthor",
Address: ["5 Upper Ter"], CityName: "SF" };
Validate(addr, Address); // returns true if valid, errors go in an error object like AR
// Here are some possibilities:
// implicit type
var Address = {
@bronson
bronson / README.md
Created October 10, 2011 17:45
Rig to demonstrate my problem using rbenv exec.

This is a quick rig to demonstrate my problem using rbenv exec.

Run:

cd parent
ruby test.rb
  • The parent should run on Ruby 1.9.2-p290
  • It should then fork a child that runs on system ruby
  • It then tries again setting RBENV_VERSION=system too.
@bronson
bronson / tcmalloc.patch
Created November 11, 2011 20:55
Compiling ree on Fedora 16
# How to compile ree-1.8.7-2011.03 on Fedora 16:
rvm install ree --force --patch tcmalloc.patch --patch ~/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch
@bronson
bronson / gist:1360039
Created November 12, 2011 04:26
ree-1.8.6 error
g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DND
g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DND
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I./src
g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DND
g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DND
/bin/sh ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I./src
g++ -DHAVE_CONFIG_H -I. -I. -I./src -I./src -DNO_TCMALLOC_SAMPLES -pthread -DND
src/system-alloc.cc: In member function ‘virtual void* SbrkSysAllocator::Alloc(s
src/system-alloc.cc:165:19: error: expected type-specifier before ‘ptrdiff_t’
src/system-alloc.cc:165:19: error: expected ‘>’ before ‘ptrdiff_t’