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.
- You WANT Rails to fail locally if a gem isn't in your Gemfile
#!/usr/bin/env bash | |
# ================================================================================ | |
# A git-diftool utility for a TeX file using `latexdiff`. | |
# | |
# | |
# Usage | |
# ----- | |
# git latexdiff [<commit>] | |
# git latexdiff --cached [<commit>] | |
# |
sudo a2enmod proxy_http | |
sudo service apache2 restart |
# 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 |
# connect to postgres | |
psql -h localhost | |
# create database | |
CREATE DATABASE mydatabase; | |
# switch to your database | |
\connect mydatabase | |
# add postgis extension |
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.
#!/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> |
Spoiler alert: Readers win.
@ivar
might not exist and nothing will fail ivar
will complain.alias_method_chain
ed# 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 |
#!/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" |
### 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 |