This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in routes.rb | |
devise_for :users, :controllers => { :registrations => "registrations" } | |
class RegistrationsController < Devise::RegistrationsController | |
protected | |
def after_sign_up_path_for(resource) | |
# anywhere you want to go | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. git remote add upstream <origin repo> | |
2. git fetch upstream | |
3. git merge upstream/master | |
4. git push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.nginx</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<true/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# before filter for api controller | |
def verify_authenticity_token | |
@current_user = User.find_by_authentication_token(params[:auth_token]) | |
render status: 401, json: { message: '...' } and return unless @current_user | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local domain | |
port 7878 | |
proto udp | |
dev tun | |
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt | |
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt | |
key /etc/openvpn/easy-rsa/2.0/keys/server.key | |
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem | |
ifconfig-pool-persist ipp.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Problem: | |
You have a javascript array that likely has some duplicate values and you would like a count of those values. | |
Solution: | |
Try this schnippet out. | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/local/var | |
mkdir postgres9.2 | |
# Initialize a the new postgres 9.2 database | |
initdb /usr/local/var/postgres9.2 | |
# Tell postgres we are upgrading the existing postgres database to the new postgres9.2 location | |
pg_upgrade -d /usr/local/var/postgres/ -D /usr/local/var/postgres9.2 -b /usr/local/Cellar/postgresql/9.1.4/bin/ -B /usr/local/Cellar/postgresql/9.2.1/bin/ -v | |
# Swap the folders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fix_select(selector) { | |
selectedVal = $(selector).children(':selected').val(); | |
$(selector).children('option').removeAttr('selected'); | |
$(selector).children('option[value="'+selectedVal+'"]').attr('selected','selected'); | |
$(selector).removeClass('jqTransformHidden'); | |
$(selector).css('display','block'); | |
$(selector).prev('ul').remove(); | |
$(selector).prev('div.selectWrapper').remove(); |