Skip to content

Instantly share code, notes, and snippets.

View sferik's full-sized avatar

Erik Berlin sferik

View GitHub Profile
@sferik
sferik / gist:269793
Created January 5, 2010 22:13 — forked from carllerche/gist:177377
Thread.new is slow
require "rubygems"
require "rbench"
def noop
end
RBench.run(100_000) do
column :one, :title => "Unthreaded"
column :two, :title => "Threaded"
#!/bin/sh
#
# This script is an adaptation from http://www.sqlite.org/cvstrac/wiki?p=ConverterTools
# It expects stdin input from mysqldump with the following params:
# mysqldump --skip-extended-insert --add-drop-table --compatible=ansi --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset
# Note: Don't use --skip-quote-names as this script expects quoted names
#
# Note: This script imports boolean values as they are stored in Mysql, e.g., as the integers 0 and 1.
# As a result, boolean fields need to be further normalized after this transform step
# such that false field values are 'f' and true field values are 't', which is
@sferik
sferik / config.rb
Created November 20, 2009 00:59 — forked from merbjedi/config.rb
MerbAdmin DSL
MerbAdmin.config User do
label "Users" # @model.pretty_name
list do
before do
puts "Called before list"
end
fields :name, :description # All columns
filters :publication_date, :retired # All booleans
<script type="text/javascript">
$(document).ready(function(){
$.stratus({
auto_play: true,
download: false,
key: "Enter your Client ID here",
links: 'http://soundcloud.com/qotsa',
random: true
});
});
<script type="text/javascript">
$(document).ready(function(){
$.stratus({
key: "Enter your Client ID here",
links: "https://soundcloud.com/zedsdead/sets/somewhere-else-ep"
});
});
</script>