Skip to content

Instantly share code, notes, and snippets.

View thibaudgg's full-sized avatar

Thibaud Guillaume-Gentil thibaudgg

View GitHub Profile
@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)
@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
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 / 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.

# 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 / 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'
@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 / 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 / gist:6713b377c1c901677101
Created December 5, 2014 08:01
Keybase.io verification
-----BEGIN PGP MESSAGE-----
Comment: GPGTools - https://gpgtools.org
owF9Ul9sFEUcvqsCpQQkgcIDJm1WbYTUc2ZnZmenjQmkp4hKKFCMGMI5Mzt7XY7b
vdvdHhQoASUoorXBhP8ECBoh8QETQkhIikQxxgMegJQ/EXmA8McIhRdiSozOXjCi
D87TzPy+75vf9/tmYPxTqYZ0qYsUj6Y7Qbp6R6S61rsvrjZE4PQabasNudxTfpzs
fF5URptRUL2CRyrjBc1+4KjMsqj5MabVqKgw8gJfo0CGZpDR15rAE7Lr+XkVlkIv
0TIoJg7BipsQuYACB0jLVNxFlGFoE0mZJFzaNteS3UEU/+tVo6aZ85xEp4bvoKyD
zOqw7Vm61lMrQBdDxjhHhLkEWFJwAKTCAlOHIwhAAoxU+NhS3O0J3uPk80nDRRUW
lqtcGAQ11zL2EgzEkFLLwgjplnjUrVmMME4hlQgjbDKHQWC6li0Bcm1uY8u1iGm6
POST /oauth/token HTTP/1.1
Content-Type: application/json

{
  "grant_type": "password",
  "client_id": "CLIENT_ID",
  "owner_type": "OWNER_TYPE",
  "username": "OWNER_EMAIL",
 "password": "OWNER_PASSWORD"