Skip to content

Instantly share code, notes, and snippets.

Clément Hussenot chussenot

Block or report user

Report or block chussenot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ruby2dtrace.md

The aim of this post is to guide the reader through the process of installing ruby 2.0.0 into rbenv with dtrace probes enabled. As rbenv uses ruby-build, which currently downloads and compiles a copy of openssl rather than using the one maintained and updated in homebrew i prefer to use the homebrew one.

Note that you MUST install xcode before installing anything, then install homebrew, and lastly install openssl, via homebrew as follows.

brew install openssl

Next to overcome the fact that OSX doesn't have an openssl ca certificate bundle, use the following brew to create and maintain one using the CA certs stored in your keychain.

View gist:5467243
# vim: se ft=ruby :
# ${HOME}/.pryrc
# https://github.com/carlhuda/bundler/issues/183#issuecomment-1149953
if defined?(::Bundler) || File.exists?('Gemfile')
global_gemset = ENV['GEM_PATH'].split(':').grep(%r{ruby.*@global|gemsets/global}).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
View working on a smart template for rails 4 application
# encoding: utf-8
# see http://edgeguides.rubyonrails.org/rails_application_templates.html
# USAGE
# rake rails:template LOCATION=/path/to/template.rb
# rails new testing_template -m template.rb
# Git
git :init
@chussenot
chussenot / .bash_aliases
Last active Aug 29, 2015 — forked from changa/.gitconfig
My configuration
View .bash_aliases
alias be="bundle exec"
alias ll="ls -la"
alias g='git'
View Load tests and Bench.md

Load Tests

Loader IO

http://loader.io/ Loader.io is a free load testing service that allows you to stress test your web-apps/apis with thousands of concurrent connections.

Gatling

https://github.com/excilys/gatling Gatling is a stress tool. Development is currently focusing on HTTP support.

View gist:dc4305ba20b11a3e53ac
2.1.1|chussenot:~/Sites/bluporter(spk-fix_spec_helper) $ rspec
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/simplecov-html-0.8.0/lib/simplecov-html.rb:58: warning: possibly useless use of a variable in void context
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/gaston-0.6.0/lib/gaston/configuration.rb:26: warning: method redefined; discarding old env=
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/array.rb:45: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/binary.rb:110: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/code.rb:86: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bson-2.3.0/lib/bson/code_with_scope.rb:93: warning: shadowing outer local variable - encoded
/Users/chussenot/.rbenv/versions/2.
View gist:c5e13508365b44e1d108
require 'net/http'
require 'json'
uri = URI("https://api.github.com/gists")
payload = {
'description' => "My test gist",
'public' => true,
'files' => {
'test.txt' => {
View angular_html5_config.md

A Working configuration to setup HTML5 push-state routing in your AngularJS app with Nginx as your web server.

View Reload Grape API in Dev Env.rb
INSPIRATION: https://github.com/intridea/grape/issues/131#issuecomment-10413342
File: config/application.rb
config.autoload_paths += %W(#{config.root}/app/api #{config.root}/app/api/*/*)
File: config/environments/development.rb
# Add below code before DummyApp::Application.configure BLOCK
View cursor_helper.rb
module Api
module V2
module Util
module CursorHelpers
extend ActiveSupport::Concern
# apply cursor-based pagination to a collection
# returns a hash:
# results: (paginated collection subset)
# next: (cursor to the next page)
You can’t perform that action at this time.