Skip to content

Instantly share code, notes, and snippets.


Romain Champourlier rchampourlier

View GitHub Profile
rchampourlier / deploy.rb
Created October 12, 2011 15:23
Capistrano recipe all-in-one: deploy rails app with rvm & bundler, run on unicorn, proxied by nginx
View deploy.rb
# Romain Champourlier ©
# Inspired from many gist, recipes on github, tutorials... essentially:
# -
# -
# -
# MIT License
# - Intended for Ubuntu 10.04.3
rchampourlier / gist:1079119
Created July 12, 2011 22:18
nginx configuration file template for HTML-serving, reverse-proxying PHP and Rails apps through Passenger and standalone rails servers
View gist:1079119
user www;
worker_processes 1;
daemon on;
error_log /var/log/nginx/error.log warn;
timer_resolution 500ms;
events {
worker_connections 512;
rchampourlier / capybara_remote.rb
Created November 8, 2012 11:07
Capybara configuration connecting to selenium server for testing with a remote browser (pretty useful in Vagrant)
View capybara_remote.rb
# SELENIUM_SERVER is the IP address or hostname of the system running Selenium
# Server, this is used to determine where to connect to when using one of the
# selenium_remote_* drivers
# SELENIUM_APP_HOST is the IP address or hostname of this system (where the
# tests run against) as reachable for the SELENIUM_SERVER. This is used to set
# the Capybara.app_host when using one of the selenium_remote_* drivers
rchampourlier / session_mock.rb
Created April 16, 2017 21:29
SessionMock: a small module to help mocking sessions within Hanami in feature specs
View session_mock.rb
# Session mocking may be used in feature tests to mock a session
# since it's not possible to inject the session through params or
# direct injection.
# SessionMock is a module that may be included
# in `Hanami::Web::Action` to override the session
# in feature specs.
# Usage (in the controller action):

Keybase proof

I hereby claim:

  • I am rchampourlier on github.
  • I am rchampourlier ( on keybase.
  • I have a public key whose fingerprint is 0C55 7AA0 27D3 F5FE 1510 1FFF 4CDA 7FE8 66D0 3D97

To claim this, I am signing this object:

rchampourlier / lazy_script.scpt
Created May 26, 2012 14:24
AppleScript for lazy developer on a Mac: opens multiple terminal tabs, run a set of commands on each tab
View lazy_script.scpt
-- This script...
-- It assumes when you ssh into the vagrant box you automatically cd into
-- the project's directory (by having a `cd /vagrant` within your
-- `~/.bashrc` for example)
using terms from application "Terminal"
tell application "Terminal"
-- open the terminal's window, set its dimensions
rchampourlier / Gemfile
Created October 2, 2016 12:28
Add SpecMetrics to your Rails project
View Gemfile
# Add this gem to your Gemfile
gem 'aws-sdk', '~> 2.5.1'
rchampourlier / nginx.proxy.server.phoenix.conf
Last active September 10, 2016 11:36
Nginx server conf file for Phoenix local development
View nginx.proxy.server.phoenix.conf
# This config for Nginx provides you a local domain
# ( for Phoenix webserver development.
# ## Prerequisites
# - You must update you /etc/hosts file accordingly.
# - You must create a self-signed certificate if you
# intend on using the HTTPS proxying.
# Add this file in the /servers directory accompanying
# your nginx.conf file.
rchampourlier / example_spec.rb
Created August 14, 2012 14:46 — forked from henrik/example_spec.rb
Testing Draper decorators with real helpers, including URL helpers.
View example_spec.rb
require "spec_helper"
# :draper_with_helpers is necessary for the Draper objects
# to access real helpers, including URL helpers, in the spec.
describe MyDecorator, "#foo", :draper_with_helpers do
# This is necessary for the spec itself to use URL helpers
# like some_path().
include Rails.application.routes.url_helpers
rchampourlier / Gemfile
Created January 5, 2013 22:18
Bundler issue information for "`Illformed requirement [""]` when calling `bundle update somegem`" issue
View Gemfile
source ''
# Framework
gem 'rails', '~> 3.2.0'
# Datastores
gem 'pg'
gem "mongoid"
gem "mongo"
gem "bson"