Skip to content

Instantly share code, notes, and snippets.

brew install libxml2
brew link libxml2
brew install https://raw.github.com/adamv/homebrew/master/Library/Formula/libxslt.rb
brew link libxslt
brew install libiconv
brew link libiconv
if you get "Fixing ld: warning: in /usr/local/lib/libz.dylib, file is not of required architecture" error
@mrsweaters
mrsweaters / nginx_virtual_host
Created October 23, 2011 17:10 — forked from scottlowe/etc_init.d_unicorn_example.co.uk
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
upstream example-workers {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out).
server unix:/tmp/example.co.uk.socket fail_timeout=0;
}
server {
listen 80; # default;
server_name example.co.uk;
root /home/example.co.uk/website/public;
@mrsweaters
mrsweaters / cancel_sort
Created November 15, 2011 00:38
Cancel sort on elements with certain class
$('ul').sortable({
start: function(event, ui) {
if ($(ui).hasClass('header')) {
$(this).sortable('cancel')
}
}
});
@mrsweaters
mrsweaters / setup.sh
Created February 5, 2012 04:18 — forked from erotte/server_setup.md
Vagrant Box Setup Ruby 1.9.3/Nginx/Passenger/MySQL
#!/usr/bin/env bash
# login as root and run this script via bash & curl:
apt-get update
apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
git-core zlib1g zlib1g-dev libopenssl-ruby libcurl4-openssl-dev libssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev \
mysql-client mysql-server
@mrsweaters
mrsweaters / nginx-init
Created February 5, 2012 08:56 — forked from mhayes/nginx-init
nginx init script (ubuntu + passenger-nginx-module)
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu <=9.10.
# Description: nginx init.d dash script for Ubuntu <=9.10.
### END INIT INFO
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyNnqM6jIwhg53FPG/y99cKJHHomKUZt/6+1d0Kjvu9SuVM06FLfCh9Dy3ymTi5slcHALTmtSzpgspkuUsRbN9DDxPwdNk8TQRz0KA1n0S51UoG4nfMTyQxVwno+kxCAklNexKlSusIytXcLgnnJ476X1CkPYyOjuZ7/MbwIUc9IZD4RUbuHBr5KqPlrXQDd6Es2dYRDvyMFPPO4Xf6LRxIaotBQM4KcztgzMZJsUPcVqCYxhLyJEMqK3Oej63hwmaAkWmF7BX3oR3c9K7YIZC/K+45VjW6MhAKDyGBmg7yg4gTsdyj+sPhMfq8wOiDdqC4Q5Y/taSKnJL5dYZXHMDQ== [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyW+iJ5g//fX3Zepne86K6i9Jg4bH2vp7dHautBZqs5TzrPwKmsH4vr0KZ6jR9IP6gPusKInpNsg3WOTJWXt/R5qB/NezHjx8bDx6djuLFZmTiLC+yhhcxbrdGufxBqYbhunQVy2RvrvlB6hEVy+kw6GaMCETC1xRT9lD6yMAprpgl81z4pILY0eO1bXradhZp3mSZbodEU4S3dNaK1xncPmmB1QeAvCNjE9+sMzqL4BqYrx193PIQu/A7SUUdT/+8zU1xdyr9jaTNy0TmBWY4Vx49rtM2tWuBzeaghxqjTfE91EOHYJQ894EUJPgn+QKSbdqUYddDhgmCJS9b0Krww== [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0c13IZTgrNN4c+PfuNWm92zvYYeBRPlgIhdDlQIQJ33Q4UXqJ3dIAERS5I7423Ue+Sxf43A+L6uWUv+JwpVL7qNtmTYQ6hTzdN4MXf6rdhNOBY6t2eXaRM7Ki+zAkXNIRm/zdkNX8PdwmAp1NGst1OisdvoMsrrdFt3Y2czo75Y2Z1i2Ppa5R
@mrsweaters
mrsweaters / favicons.html
Created April 2, 2012 17:16
Favicon Markup
<!-- For third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png">
<!-- For iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png">
<!-- For first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
<!-- Regular browser favicon: -->
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
@mrsweaters
mrsweaters / geg.txt
Created July 6, 2012 16:28
Good enough granola
2 cups oats
1 cup goji berries
1 cup chopped cashews
1/4 cup hemp seeds
1/4 cup agave nectar
1/2 cup canola oil
1 tsp vanilla
1/2 tsp sea salt
bake in the oven on 250 for 1 hour
@mrsweaters
mrsweaters / vote.rb
Created July 16, 2012 23:59
HTML5 Video Voting backend
class Vote < ActiveRecord::Base
belongs_to :video
belongs_to :user
has_one :comment
validates :vote_is_not_in_same_bar, :presence => {:on => :create}
def self.time_intervals(params)
bars = params[:bars].to_i
groups = Array.new(bars, 0)
vote = Vote.where(:video_id => params[:video_id]).first
@mrsweaters
mrsweaters / gist:3157259
Created July 21, 2012 21:32 — forked from dalibor/gist:1534053
Stop words
a
about
above
across
after
afterwards
again
against
all
almost