Skip to content

Instantly share code, notes, and snippets.

View tisba's full-sized avatar
🚀
Perf Testing all the Things!

Sebastian Cohnen tisba

🚀
Perf Testing all the Things!
View GitHub Profile
[2010-09-02 22:10:52] make
file.c: In function ‘file_expand_path’:
file.c:2844: warning: ‘b’ may be used uninitialized in this function
regcomp.c: In function ‘add_compile_string_length’:
regcomp.c:423: warning: implicit conversion shortens 64-bit value into a 32-bit value
regcomp.c:431: warning: implicit conversion shortens 64-bit value into a 32-bit value
regcomp.c: In function ‘compile_string_raw_node’:
regcomp.c:550: warning: implicit conversion shortens 64-bit value into a 32-bit value
regcomp.c: In function ‘get_char_length_tree1’:
regcomp.c:2308: warning: implicit conversion shortens 64-bit value into a 32-bit value
@tisba
tisba / gist:703646
Created November 17, 2010 16:59
TextMate command snippet for the gemedit gem
#!/usr/bin/env ruby
# REQUIREMENTS:
#
# gem install gemedit
#
# INSTALLATION:
#
# Create a new TextMate command, paste this code, assign an activation shortcut,
# set output to "Show as Tool Tip" and done.
#!/usr/bin/env bash
rm -rf ~/.rvm/usr
rvm package install iconv
rvm package install readline
rvm package install zlib
rvm package install autoconf
rvm use system
rvm remove 1.9.2
rvm install 1.9.2 --with-iconv-dir=$rvm_path/usr \
--with-readline-dir=$rvm_path/usr \
npm install qunit
npm info it worked if it ends with ok
npm info using npm@0.2.5-1
npm info install qunit@0.0.4
npm info preinstall qunit@0.0.4
npm info install qunit@0.0.4
cd ./deps/jscoverage/ && ./configure && make
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
@tisba
tisba / gist:642163
Created October 23, 2010 12:35
Nested object decoding with json-gem
require "rubygems"
# require "yajl/json_gem"
require "json"
class FooBarBase
attr_accessor :name, :type
def initialize(attributes = {})
attributes.each { |attr_name, attr_value| send("#{attr_name}=", attr_value) }
end
#!/usr/bin/env bash
# where do you want couchdb and its deps to be installed
COUCHDB_PREFIX="/opt/couchdb-1.0.1"
# Let's determine the correct arcitecture and choose the installer
if [ "`uname -m`" = "x86_64" ]; then
echo "Using 64-bit installer"
COUCHDB_INSTALLER_DOC_ID="26f246a0fe23d6a53d5326713308f43c"
COUCHDB_INSTALLER_BIN="install-couchdb-1.0.1_rel1-linux-x64.bin"
Scenario: Get List of My Hitchhiking Items via API
Given the existing things:
|name|
|The Guide (duh)|
|A towel|
|Sub-Etha Sens-O-Matic|
|Pan Galactic Gargle Blaster|
|Kill-o-Zap blaster pistol|
And the existing accounts:
|email|name|password|
#!/usr/bin/env bash
# Build CouchDB 1.0.1 from source using build-couchdb. All needed dependencies
# are also build from source and form a self-contained installation. Specifiy
# COUCHDB_PREFIX to the location where you would like to have everything
# installed to.
# When everything is done, the init.d-script and default settings for CouchDB
# are linked to the right places, the bind address is set to 0.0.0.0 and CouchDB
# will be started, so you can relax!
#!/usr/bin/env bash
# add partner sources
echo -e "deb http://archive.canonical.com/ubuntu lucid partner \n\
deb-src http://archive.canonical.com/ubuntu lucid partner" >> /etc/apt/sources.list
# update package list
apt-get update
# read and accept the agreement
@tisba
tisba / partials.rb
Created August 10, 2010 14:53 — forked from lenary/partials.rb
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)