Skip to content

Instantly share code, notes, and snippets.

View rodrigopinto's full-sized avatar

Rodrigo Pinto rodrigopinto

  • Berlin, Germany
  • 17:53 (UTC +01:00)
View GitHub Profile
#!/bin/bash
echo "Automated Setup for Ubuntu 10.04 LTS(Lucid) - REE + Rails with Nginx + Mercurial + postfix"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
echo "------------------------------------------------------------------"
@rodrigopinto
rodrigopinto / gist:1166449
Created August 23, 2011 20:38 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
#Colors
NO_COLOR="\[\e[0m\]"
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
MAGENTA="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
WHITE="\[\033[0;37m\]"
@rodrigopinto
rodrigopinto / spec_helper.rb
Created October 25, 2012 15:53 — forked from caike/spec_helper.rb
missing translations
##
# Raises error if missing translation key
##
config.before(:all, type: :controller) do
@_i18n_exception_handler = I18n.exception_handler
I18n.exception_handler = lambda { |*args| raise args.first.to_s }
end
config.after(:all, type: :controller) do
I18n.exception_handler = @_i18n_exception_handler
module NumberPercentageExtension
module InstanceMethods
# the idea converting english to numbers taken from http://www.ruby-forum.com/topic/132735#591799
ENGLISH_VALUE = {}
%w| zero one two three four five six seven eight nine ten eleven
twelve thirteen fourteen fifteen sixteen seventeen eighteen
nineteen |.each_with_index{ |word,i| ENGLISH_VALUE[word] = i }
%w| zero ten twenty thirty forty fifty sixty seventy eighty
ninety|.each_with_index{ |word,i| ENGLISH_VALUE[word] = i*10 }

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

# Configuration file for Unicorn
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# See also http://unicorn.bogomips.org/examples/unicorn.conf.rb for
# a more verbose configuration using more features.
app_name = "appname"
root = "/home/deployer/apps/#{app_name}/current"
#!/bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage unicorn server
# Description: Start, stop, restart unicorn server for a specific application.
### END INIT INFO