Skip to content

Instantly share code, notes, and snippets.

View joselo's full-sized avatar

Jose Carrion joselo

View GitHub Profile
@joselo
joselo / elements.md
Created November 19, 2011 18:04 — forked from soveran/elements.md
Excerpts from The Elements of Programming Style. The source of this compilation is unknown.

The Elements of Programming Style

The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."

@joselo
joselo / Gemfile
Created November 7, 2011 02:12 — forked from mislav/Gemfile
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass'
end
@joselo
joselo / .bash_Profile
Created October 9, 2011 05:16
My.bash_profile in Mac OS X Lion
# Mac OS X: brew install bash-completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
export PS1='\w$(__git_ps1 " \[\033[01;33m\](%s)")\[\033[00m\]\$ '
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
@joselo
joselo / spec_helper.rb
Created September 12, 2011 22:02 — forked from ryanb/spec_helper.rb
Focus on specific specs in RSpec
# add this to your spec helper
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
# and then use the :focus tag in your specs
it "does something awesome", :focus do
@joselo
joselo / gist:1199609
Last active December 30, 2016 21:15
my promnt
export PS1='\w$(__git_ps1 " \[\033[01;33m\](%s)")\[\033[00m\]\$ '
# ArchLinux
source /usr/share/git/completion/git-completion.bash
source /usr/share/git/completion/git-prompt.sh
PS1='\w$(__git_ps1 " \[\033[01;33m\](%s)")\[\033[00m\]\$ '
@joselo
joselo / gist:1174201
Created August 26, 2011 19:22
capybara webkit
gem install libqt4-dev
@joselo
joselo / wait_until.rb
Created August 26, 2011 02:46 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
click_link 'My HomeMarks'
within '#login_area' do
fill_in 'email', with: '[email protected]'
fill_in 'password', with: 'test'
@joselo
joselo / project.js
Created August 19, 2011 23:48
Write Javascripts as an object
var project;
$(function(){
var Project = function(){
var that = this;
var setupProject = function(){
};
that.someMethod = function(){
@joselo
joselo / I18n devise es
Created August 9, 2011 03:44 — forked from scambra/I18n devise es
devise I18n file in spanish
es:
errors:
messages:
not_found: 'no encontrado'
already_confirmed: 'ya ha sido confirmada'
not_locked: 'no está bloqueada'
expired: "ha caducado, por favor pide uno nuevo"
not_saved:
one: "1 error evitó guardar este %{resource}:"
other: "%{count} errores evitaron guardar este %{resource}:"
@joselo
joselo / .rvmrc
Created July 24, 2011 22:08
.rvmrc demo file
if [[ -n "$rvm_environments_path" && -s "$rvm_environments_path/ruby-1.9.2-p180@project_name" ]] ; then
\. "$rvm_environments_path/ruby-1.9.2-p180@project_name"
else
rvm --create use "ruby-1.9.2-p180@project_name"
fi