Skip to content

Instantly share code, notes, and snippets.

View thibaudgg's full-sized avatar

Thibaud Guillaume-Gentil thibaudgg

View GitHub Profile
@thibaudgg
thibaudgg / masrad_frm_rails_exam_2.md
Last active August 29, 2015 14:02
Knowledge Exam MAS­RAD/FRM/RAILS/2

Exam MAS­RAD/FRM/RAILS/2

Setup

Update your upstream remote and merge it to your master branch.

  • $ git fetch upstream
  • $ git checkout master
  • $ git merge upstream/master
@thibaudgg
thibaudgg / case_bench.rb
Created May 23, 2014 05:09
Benchmark between string/regex Ruby case
require 'benchmark/ips'
key = 'evelolink.core.user.suspended'
Benchmark.ips do |x|
x.report("case_regexp") do |times|
i = 0
while i < times
case key
when /created/ then :welcome
@thibaudgg
thibaudgg / gist:7659392
Last active December 29, 2015 10:49 — forked from riverock/gist:7600741
Fix dir2 path
# Using Ruby 2.0.0p195 and listen 2.3.0
require 'listen'
require 'fileutils'
dir1 = '/Users/blue39/tmp/dir1'
FileUtils.remove_dir(dir1, true)
FileUtils.mkdir_p(dir1)
dir2 = '/Users/blue39/tmp/dir2'
# Include this in your spec_helper.rb:
config.expect_with :rspec do |c|
c.syntax = :expect
end
# Then, run:
find spec -name "*.rb" -exec gsed -i -e "s/\(\s\+\)\(.*\)\.should_not /\1expect(\2).not_to /g" -e "s/\(\s\+\)\(.*\)\.should /\1expect(\2).to /g" "{}" \;
# About RSpec's New Expectation Syntax
# http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
@thibaudgg
thibaudgg / 0_README.md
Last active December 11, 2015 20:18 — forked from nilcolor/0_README.md

ruby-1.9.3-p374 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p374 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@thibaudgg
thibaudgg / Gemfile
Created May 3, 2012 09:26
Jilion Guard blog post
group :tools do
# Guard
gem 'growl'
platforms :ruby do
gem 'rb-readline'
end
gem 'guard-pow'
gem 'guard-livereload'
gem 'guard-jasmine'
@thibaudgg
thibaudgg / hoptoad.rb
Created June 21, 2011 14:06
Custom Goliath Rack middleware for HoptoadNotifier
module Goliath
module Rack
class Hoptoad
include Goliath::Constants
def initialize(app)
@app = app
end
def call(env)
@thibaudgg
thibaudgg / Gemfile.lock
Created January 5, 2011 08:09
Bigtuna deploy
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (= 3.0.3)
mail (~> 2.2.9)
actionpack (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
---
- !ruby/struct:VCR::HTTPInteraction
response: !ruby/struct:VCR::Response
body: &id002 !str
str: ""
"@net_http_res": !ruby/object:Net::HTTPOK
body: *id002
@thibaudgg
thibaudgg / irbrc
Created June 12, 2010 19:41
irbrc compatible with Rails 3
# ===========
# = Configs =
# ===========
%w[rubygems wirble pp].each do |gem|
begin
require gem
rescue LoadError => err
warn "Please do: gem install #{gem.sub(/\/.*/,'')}"
end