Skip to content

Instantly share code, notes, and snippets.

View czj's full-sized avatar

Clément Joubert czj

View GitHub Profile
alfred://customsearch/Traduire%20en%20francais/en/utf8/noplus/https://translate.google.fr/#en/fr/{query}
alfred://customsearch/Traduire%20en%20allemand/en/utf8/noplus/https://translate.google.fr/#fr/de/{query}
alfred://customsearch/Traduire%20en%20anglais/en/utf8/noplus/https://translate.google.fr/#fr/en/{query}
module LineWithTaxes
extend ActiveSupport::Concern
included do
validates_length_of :label, within: 2..254
validates_length_of :comment, within: 0..254, allow_blank: true
validates_numericality_of :amount_with_taxes, :amount_without_taxes
validates_numericality_of :quantity, minimum: 1, only_integer: true
validates_numericality_of :ecotax, minimum: 0
ignore %r{^(public/e|tmp|log|deprecated)}
group "app" do
guard :bundler do
watch 'Gemfile'
end
guard :pow do
watch %r{^config/.+\.yml$}
watch %r{^config/environments/.+\.(rb|yml)$}
{
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
@czj
czj / rbenv_install.markdown
Last active February 22, 2022 11:20
Install rbenv on a Linux server, desktop or OSX, with bash or zsh

SERVER

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

DESKTOP

BASH

@czj
czj / lol-shortcuts.txt
Created March 10, 2014 20:20
Raccourcis LOL Windows (chat, cast, etc...)
Standard Keyboard Shortcuts:
q,w,e,r - linked to your abilities
d,f, - linked to your summoner spells
y - locks/unlock you camera
L - shows/hides lifebars
spacebar - center's your hero on screen
b - back/recall
p - opens item shop
g - turns mouse to ping click (click anywhere on screen or hero to ping)
alt + left click - same as above
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.12'
gem 'pg' # PostgreSQL
gem 'dalli' # Modern & fast pure-ruby memcached client
gem 'rack-cache' # HTTP caching (only one available for heroku)
gem 'slim' # Faster-than-HAML templating engine
gem 'kaminari' # Rails 3 scopes based pagination
gem 'stringex' # Convert string to ascii, to url
@czj
czj / get_production_db.sh
Created November 21, 2012 10:17
Transfert Heroku production db to local dev db
#!/bin/bash
# Get to the Rails app's root directory
cd `dirname $0`/..
APP_DIRECTORY=`pwd`
APP_NAME=`basename $APP_DIRECTORY`
# How-to:
# http://www.ryandaigle.com/a/pgtransfer-is-the-new-taps
@czj
czj / Railscasts.tmTheme
Created October 25, 2012 13:38
Railscasts theme + Ruby 1.9 hash syntax
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Railscasts</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
$baseFontSize: 12px
$baseLineHeight: 18px
$headingsFontWeight: normal
$headingsColor: #1A3E8E
$linkColor: #2f5bb9
$btnInverseBackground: #666
// Core variables and mixins
// Modify this for custom colors, font-sizes, etc
@import "bootstrap/variables"