Skip to content

Instantly share code, notes, and snippets.

View sauloperez's full-sized avatar
🏔️

Pau Pérez Fabregat sauloperez

🏔️
View GitHub Profile
@tkanmae
tkanmae / git-latexdiff.sh
Created August 5, 2011 21:54
A git-diftool utility for a TeX file using `latexdiff`
#!/usr/bin/env bash
# ================================================================================
# A git-diftool utility for a TeX file using `latexdiff`.
#
#
# Usage
# -----
# git latexdiff [<commit>]
# git latexdiff --cached [<commit>]
#
@cdarne
cdarne / apache_setup.sh
Created May 24, 2012 11:17
Upstart/init.d config example for rails/passenger
sudo a2enmod proxy_http
sudo service apache2 restart
@semperos
semperos / simple-upstart.conf
Created June 18, 2012 15:05
Simple Ubuntu Upstart config
# goes inside /etc/init/foo.conf
# Upstart: /etc/init/service_name.conf
description "start passenger stand-alone"
author "Me <me@myself.am>"
# Stanzas
#
# Stanzas control when and how a process is started and stopped
# See a list of stanzas here: http://upstart.ubuntu.com/wiki/Stanzas#respawn
@spara
spara / createdb.sql
Created July 26, 2012 21:22
create database
# connect to postgres
psql -h localhost
# create database
CREATE DATABASE mydatabase;
# switch to your database
\connect mydatabase
# add postgis extension
@jaymcgavren
jaymcgavren / heroku.md
Created May 25, 2012 05:47
A Code TV screencast on getting started with Heroku

Description

Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.

Set up your Rails app

Isolate your gem environment

  • You WANT Rails to fail locally if a gem isn't in your Gemfile
@grosser
grosser / rake_autocomplete.rb
Created August 19, 2012 15:50 — forked from cayblood/rake_autocomplete.rb
Bash autocomplete script for rakefiles
#!/usr/bin/env ruby
# Complete rake tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default rake
# to your ~/.bashrc
# Xavier Shay (http://rhnh.net), combining work from
# Francis Hwang ( http://fhwang.net/ ) - http://fhwang.net/rb/rake-complete.rb
# Nicholas Seckar <nseckar@gmail.com> - http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces
# Saimon Moore <saimon@webtypes.com>
@franciscoj
franciscoj / ivar_vs_reader.md
Last active May 9, 2016 17:27
ivar vs reader

Ruby: ivar vs readers

Spoiler alert: Readers win.

  1. You don't rely on the instance state.
  2. You've better protection againt typos. @ivar might not exist and nothing will fail ivar will complain.
  3. They're easier to mock in specs in case you need to.
  4. They properly wrap the state so that refactors are easier
  5. they can be aliased
  6. they can be alias_method_chained
@lucasallan
lucasallan / install_postgis_osx.sh
Created September 6, 2011 21:03 — forked from klebervirgilio/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@mkllnk
mkllnk / post-receive
Created July 11, 2018 08:49
OFN Aus deployment script
#!/bin/sh
set -e
APP_PATH="$HOME/apps/openfoodnetwork"
CURRENT_PATH="/home/openfoodnetwork/apps/openfoodnetwork/current"
SHARED_PATH="/home/openfoodnetwork/apps/openfoodnetwork/shared"
CONFIG_PATH="/home/openfoodnetwork/apps/openfoodnetwork/shared/config"
BUNDLE="$HOME/.rbenv/shims/bundle"
GEM_PATH="/home/openfoodnetwork/.gem"
@srpouyet
srpouyet / nginx.conf
Last active August 5, 2018 22:37
Nginx Upstart script (Ubuntu 12.04)
### Nginx upstart script
### source: http://serverfault.com/a/391737/70451
### /etc/init/nginx.conf
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/sbin/nginx