Skip to content

Instantly share code, notes, and snippets.

View mathieuravaux's full-sized avatar

Mathieu Ravaux mathieuravaux

  • Paris
View GitHub Profile
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
@mathieuravaux
mathieuravaux / sl_gems_update.rb
Created September 1, 2009 08:18 — forked from mattetti/sl_gems_update.rb
Gems that need upgrading in snow leopard
#!/usr/bin/env ruby
puts "looking for the gems to upgrade..."
gem_info = Struct.new(:name, :version)
to_reinstall = []
Dir.glob('/Library/Ruby/Gems/**/*.bundle').map do |path|
path =~ /.*1.8\/gems\/(.*)-(.*?)\/.*/
name, version = $1, $2
bundle_info = `file path`
to_reinstall << gem_info.new(name, version) unless bundle_info =~ /bundle x86_64/
end
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"
@mathieuravaux
mathieuravaux / README
Created September 16, 2009 12:06 — forked from avit/README
ToadMate Bookmarklet
Adds clickable links to open the file/line from the
stacktrace on Hoptoad (http://hoptoadapp.com) into TextMate.
INSTALL:
Change the lpd variable to your local project directory.
It relies on your project folders being named after the main part
of your domain name (example.com => /example/).
<h1>Listing tasks</h1>
<table>
<tr>
<th>Name</th>
<th>Complete</th>
</tr>
<% @tasks.each do |task| %>
<tr class="<%= task.complete? ? 'tache effectuée' : 'tache NON effectuée' %>">
namespace :deploy do
PRODUCTION_APP = 'myapp'
STAGING_APP = 'myapp-staging'
def run(*cmd)
system(*cmd)
raise "Command #{cmd.inspect} failed!" unless $?.success?
end
def confirm(message)
# app/views/rescues/_trace.erb
<%
traces = [
["Application Trace", @exception.application_backtrace],
["Framework Trace", @exception.framework_backtrace],
["Full Trace", @exception.clean_backtrace]
]
names = traces.collect {|name, trace| name}
%>
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