Skip to content

Instantly share code, notes, and snippets.

View rbriank's full-sized avatar

Brian Kierstead rbriank

  • Kierstead Consulting, Inc.
  • Hamilton, ON
View GitHub Profile
CmdUtils.CreateCommand({
name: "comments",
author: {name: "Brian Kierstead", email: "[email protected]"},
description: "Reveal comments in the code.",
execute:function() {
doc = context.focusedWindow.document
if(!doc)
return;
ss = addStyleSheet(doc);
@rbriank
rbriank / rvm_version_switched.sh
Created April 5, 2010 18:26
simple rvm version switcher
# add a .rvm file to APP_ROOT containing only the version
# e.g. 1.9.1
# add this to your .bashrc file
cd () {
command cd "$@";
if [ -f ./.rvm ]; then
version=`cat ./.rvm`
if [ `ruby -v | grep -c $version` == 0 ]; then
rvm $version
require 'digest/md5'
# usage: run this in the root directory of your iTunes Music folder, or wherever, and pipe the output to a file
# next, pipe the output of that file through `sort` to a new file
# now, use the next script on that file
ls = Dir['**/*']
ls.each_with_index do |f, i|
STDERR.puts ls.length - i if (i % 100 == 0)
brian@ubuntu:~$ rvm update --head
rvm 0.1.41 by Wayne E. Seguin ([email protected]) [http://rvm.beginrescueend.com/]
From git://github.com/wayneeseguin/rvm
* branch master -> FETCH_HEAD
Already up-to-date.
RVM: shell scripts which allow management of multiple ruby interpreters and environments.
RTFM: http://rvm.beginrescueend.com/
[2010-07-07 07:30:41] tar zxf /home/vadmin/.rvm/archives/zlib-1.2.5.tar.gz -C /home/vadmin/.rvm/src
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
[2010-07-07 07:31:09] tar zxf /home/vadmin/.rvm/archives/zlib-1.2.5.tar.gz -C /home/vadmin/.rvm/src
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
[2010-07-07 07:30:41] tar zxf /home/vadmin/.rvm/archives/zlib-1.2.5.tar.gz -C /home/vadmin/.rvm/src
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
[2010-07-07 07:31:09] tar zxf /home/vadmin/.rvm/archives/zlib-1.2.5.tar.gz -C /home/vadmin/.rvm/src
gzip: stdin: invalid compressed data--crc error
tar: Child returned status 1
tar: Exiting with failure status due to previous errors
@rbriank
rbriank / .bash_aliases
Created May 23, 2011 16:34
easy rails server up and down aliases for dev - say in Scooby Doo voice
alias rown="kill -9 `ps x | awk '/rails s -d/ {print $1}'` 2> nul"
alias rup="rails s -d"
ruby-1.9.2-p180@ss Brian-Kiersteads-MacBook-Pro:matcher briankierstead$ cap staging deploy
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]:rbriank/ss_matcher.git HEAD"
ruby-1.9.2-p180@ss Brian-Kiersteads-MacBook-Pro:matcher briankierstead$ cap staging deploy
* executing `staging'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]:rbriank/ss_matcher.git HEAD"
#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \
((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key)))
#ifdef HASH_LOG
#define COLLISION collision++
#else
#define COLLISION
#endif
#define FIND_ENTRY(table, ptr, hash_val, bin_pos) do {\