Skip to content

Instantly share code, notes, and snippets.

View mathieuravaux's full-sized avatar

Mathieu Ravaux mathieuravaux

  • Paris
View GitHub Profile
require('soda').createSauceClient({ 'username': 'username-string', 'access-key': 'access-key-string',
'url': 'http://example.saucelabs.com/', 'max-duration': 300,
'os': 'Windows 2003', 'browser': 'firefox', 'browser-version': '3.6',
'name': 'This is an example test' }).chain.session()
.open('/')
.getTitle(function(title){
require('assert').ok(~title.indexOf('Cross browser testing with Selenium - Sauce Labs'), 'Title did not include the query');
})
.testComplete()
.end(function(err){

install cycript

brew install https://gist.github.com/raw/890258/cycript.rb

download the cycript hack

wget https://gist.github.com/raw/890258/hack_propane.js
chmod +x hack_propane.js

inject hack into running propane process

@mathieuravaux
mathieuravaux / gist:934033
Created April 21, 2011 09:09
Streaming the contents of an em-http-request in a Rails response
def stream
@path = request[:path]
puts "1) grabbing the output"
already_called = false
self.response_body = work_around_double_call_bug { |resp, output|
return if already_called
already_called = true
puts "3) output grabbed: #{output}. Requesting Drobpox..."
dropbox_session.stream @path do |em_http_req|
require 'rake/clean'
HAML = FileList['**/*.haml']
LESS = FileList['**/*.less']
COFFEE = FileList['**/*.coffee']
HTML = HAML.ext('html')
CSS = LESS.ext('css')
JS = COFFEE.ext('js')
diff --git a/array.c b/array.c
index b1616c5..16326fc 100644
--- a/array.c
+++ b/array.c
@@ -302,7 +302,7 @@ ary_alloc(VALUE klass)
return (VALUE)ary;
}
-static VALUE
+VALUE
kern.netboot = 0
kern.netboot: 0
net.local.stream.sendspace: 8192
net.local.stream.recvspace: 8192
net.local.stream.tracemdns: 0
net.local.dgram.maxdgram: 2048
net.local.dgram.recvspace: 4096
net.local.inflight: 0
net.inet.ip.portrange.lowfirst: 1023
net.inet.ip.portrange.lowlast: 600
kern.ostype = Darwin
kern.osrelease = 11.2.0
kern.osrevision = 199506
kern.version = Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64
kern.maxvnodes = 66560
kern.maxproc = 1064
kern.maxfiles = 12288
kern.argmax = 262144
kern.securelevel = 0
kern.hostname = Mathieus-MacBook-Air.local
# Store data in /usr/local/var/mongodb instead of the default /data/db
dbpath = /usr/local/var/mongodb
# Only accept local connections
bind_ip = 127.0.0.1
cpu = true
verbose = true
rest = true
@mathieuravaux
mathieuravaux / airbrake_initializer.rb
Created April 10, 2012 19:09
Airbrake monkeypatch to serialize correctly Mongoid documents
class ::Airbrake::Notice
def xml_vars_for(builder, hash)
hash.each do |key, value|
value = value.to_airbrake if value.respond_to?(:to_airbrake)
if value.respond_to?(:to_hash)
builder.var(:key => key){|b| xml_vars_for(b, value.to_hash) }
else
builder.var(value.to_s, :key => key)
end
end
@mathieuravaux
mathieuravaux / syntax.rb
Created April 17, 2012 16:15 — forked from slemiere/syntax.rb
redis queues syntax
all_queues = ["test", "schedule", "process"]
QUEUES = "*"
# ["test", "schedule", "process"]
QUEUES = "test,schedule"
# ["test", "schedule"]
QUEUES = "*,~test"
# ["schedule", "process"]