Skip to content

Instantly share code, notes, and snippets.

@simonc
simonc / Gemfile
Last active December 9, 2015 17:58
Unicorn on heroku
group :production do
gem 'unicorn'
end
options = {
option_1: a,
option_2: blabla,
option_3: blablablablablabla,
option_4: bblablablablablablablabla,
option_5: bblablablabla
}
local_var.method_with_hash_and_block(mandatory_param, options) do |v|
d = v.bla
@simonc
simonc / README.md
Created May 25, 2012 10:41
find_each with ActiveResource

This is an example implementation of find_each with ActiveResource

Dependencies:

API:

  • has_scope

Client:

@simonc
simonc / devise.fr.yml
Last active October 3, 2015 08:38
French translation of devise.en.yml
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
fr:
devise:
confirmations:
confirmed: 'Votre compte a été validé.'
send_instructions: 'Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes.'
send_paranoid_instructions: 'Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte.'
failure:
already_authenticated: "Vous êtes déjà connecté !"
@simonc
simonc / human.rb
Created September 9, 2011 17:41
Human DNA
class Human
attr_reader :smart
def initialize
@smart = (rand == rand)
end
end
@simonc
simonc / commit-msg.rb
Created July 20, 2010 14:49
commit-msg
#!/usr/bin/env ruby
file = ARGV.first
branch = `git br --no-color | grep '^*' | cut -d' ' -f2`.gsub(/ref-(\d+)-.*/, '\1').strip
open('/tmp/git_debug', 'a') { |f| f.puts branch }
msg = ''
if branch =~ /^\d+$/s
@simonc
simonc / subversion-unicode-path.patch
Created June 11, 2010 12:27
Subversion Unicode Path Patch
diff --git a/subversion/libsvn_subr/path.c b/subversion/libsvn_subr/path.c
===================================================================
--- a/subversion/libsvn_subr/path.c
+++ b/subversion/libsvn_subr/path.c
@@ -35,6 +35,10 @@
#include "private_uri.h"
+#if defined(DARWIN)
+#include <CoreFoundation/CoreFoundation.h>
*.swp
.DS_Store
.sass-cache
config/database.yml
db/schema.rb
log/*
public/stylesheets/*.css
tmp/*
@simonc
simonc / iSSH
Created October 14, 2009 19:35
Sets the remote hostname as iTerm background
#!/usr/bin/env bash
BG_COLOR="#000000" # Background color
FG_COLOR="#662020" # Foreground color
DIMENSIONS="570x342" # Console dimensions
GRAVITY="NorthEast" # Text gravity (NorthWest, North, NorthEast,
# West, Center, East, SouthWest, South, SouthEast)
OFFSET="20,10" # Text offset
FONT_SIZE="60" # Font size in points
FONT_FAMILY="Monaco" # Font family
@simonc
simonc / commits_for
Created October 14, 2009 19:21
Call svn log for a specific user
#!/usr/bin/env bash
username=$1
options=$2
list=''
for r in `svn log | grep $username | sed 's/r\([0-9]\+\).*/\1/'`; do
list="$list -r$r"
done