Skip to content

Instantly share code, notes, and snippets.

@kevincolten
kevincolten / subl.sh
Last active August 29, 2015 14:00
Launch Sublime Text from terminal
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :cor
def cor
headers["Access-Control-Allow-Origin"] = "http://localhost:8000"
headers["Access-Control-Allow-Methods"] = %w{GET POST PUT DELETE}.join(",")
headers["Access-Control-Allow-Headers"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(",")
head(:ok) if request.request_method == "OPTIONS"
end
@kevincolten
kevincolten / gist:8853141
Created February 6, 2014 21:46
listing all (mysql) processes and killing them
$ ps aux | grep mysql
$ sudo kill -9 629 513 #1, 5, 9 (varying levels of process killing)