Skip to content

Instantly share code, notes, and snippets.

View edward's full-sized avatar

Edward Ocampo-Gooding edward

View GitHub Profile
vjadmin@ollie:~$ time ab -n 1000000 -c 1020 -t 120 207.158.15.183/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 207.158.15.183 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
@edward
edward / gist:52827
Created January 26, 2009 14:23
Awesome OSX Terminal setup
We couldn’t find that file to show.
$ git svn rebase --all
error: refs/heads/master does not point to a valid object!
error: refs/remotes/git-svn does not point to a valid object!
error: refs/stash does not point to a valid object!
code/applications/actionpack/sessions/script/about: needs update
code/applications/actionpack/sessions/script/console: needs update
code/applications/actionpack/sessions/script/dbconsole: needs update
code/applications/actionpack/sessions/script/destroy: needs update
code/applications/actionpack/sessions/script/generate: needs update
code/applications/actionpack/sessions/script/performance/benchmarker: needs update
# This should print out
#
# [the arabic] 5.67
#
# right?
#
# Btw, run from Textmate (set the language to Ruby and hit cmd-r) or whatever your text editor.
# (Executing straight from irb seems to segfault.)
puts "ر.ق" +
#!/usr/bin/env ruby -wKU
# Usage:
# $ cat master\ no\ multivariant_2009-01-13_13.42.23.sql | ack "INSERT INTO .*?orders" | ./restore_note_attributes.rb > update_note_attributes.sql
# $ mysql your_db -u your_user < update_note_attributes.sql
require 'rubygems'
require 'fastercsv'
def extract_note_attributes(note)
module Dad
def self.make_breakfast
things_i_like("I like toast.")
puts "These are the things we should make for breakfast."
end
def self.things_i_like(things)
puts things
end
#!/usr/bin/env ruby
# sudo gem install ZenTest
# run "autotest", or "autotest -f" to skip the initial full test suite
# colour coded results
require 'autotest/redgreen'
# growl notifications...put something like this in ~/.autotest if you want
a = [
def f(a)
puts a
end,
f(1)
]
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<aws:AWSAccessKeyId env:mustUnderstand="0" xmlns:aws="http://security.amazonaws.com/doc/2007-01-01/" env:actor="http://schemas.xmlsoap.org/soap/actor/next">0BRV8WCYSJ4MJMXRNKR2</aws:AWSAccessKeyId>
<aws:Signature env:mustUnderstand="0" xmlns:aws="http://security.amazonaws.com/doc/2007-01-01/" env:actor="http://schemas.xmlsoap.org/soap/actor/next">WnK8kc9rEMtHGkX/mYbJjA406FA=</aws:Signature>
<aws:Timestamp env:mustUnderstand="0" xmlns:aws="http://security.amazonaws.com/doc/2007-01-01/" env:actor="http://schemas.xmlsoap.org/soap/actor/next">2009-08-12T19:19:48Z</aws:Timestamp>
</env:Header>
<env:Body>
<CreateFulfillmentOrder xmlns="http://fba-outbound.amazonaws.com/doc/2007-08-02/">
<MerchantFulfillmentOrderId>8af0a8f37b8e40a999ce3929a66275f4</MerchantFulfillmentOrder
@edward
edward / json-template-example.js
Created August 19, 2009 03:34
Trying to figure out how to move the JSON template out to another file
<html>
<head>
<script type="text/javascript" src="json-template.js">
</script>
<script type="text/javascript">
// Note that this requires json-template.js
function write() {