Skip to content

Instantly share code, notes, and snippets.

fastcgi_cache_path /tmp/nginx-cache levels=1:2 keys_zone=wordpress:20m inactive=1d max_size=512M;
upstream php-fpm {
server localhost:9000;
}
server {
listen 1.2.3.4:80;
listen [1:2:3:4::5]:80;
server_name blog.example.com
@ybart
ybart / DB Evolutions
Last active December 30, 2015 17:49 — forked from larste/DB Evelutions
Add support for db evolutions:
Download the sqlite-dialect from here: https://github.com/gwenn/sqlite-dialect
Compile it to a jar file.
Add the jar file the app/lib folder.
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb
class AddAuthenticationTokenToUsers < ActiveRecord::Migration
def change
add_column :users, :authentication_token, :string
add_index :users, :authentication_token, :unique => true
end
end
# Goal: Allow addition of instances to a collection in a factory-built object
# when those instances require references to the parent.
# Typically occurs in Rails when one model has_many instances of another
# See more at:
# http://stackoverflow.com/questions/2937326/populating-an-association-with-children-in-factory-girl
# Usage
# Foo has_many :bar
#