This file contains 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
class Locatable < ActiveRecord::Base | |
belongs_to :locatable, :polymorphic=>true | |
belongs_to :location | |
end | |
class Location < ActiveRecord::Base | |
has_many :locatables, dependent: :destroy |
This file contains 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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
#got brew installed on /usr/local | |
PATH="/usr/local/bin:$PATH" | |
PS1="\[\033[0;35m\]\u@\h\[\033[0;33m\] \$(parse_git_branch) \w\[\033[00m\]: " | |
#installed rvm | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function |
This file contains 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
var myAPP = {}; | |
Ti.include('windows/gallery.js'); | |
(function() { | |
myAPP.setupAnalytics=function(){ | |
var GoogleAnalytics = require('com.thinkorange.google.analytics'); | |
GoogleAnalytics.accountID = "UA-xxxxxx-1"; | |
GoogleAnalytics.debug = true; | |
GoogleAnalytics.trackUncaughtExceptions = true; |
This file contains 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) install mod deflate and expires on your apache | |
#Run the following commands: "a2enmod expires" and "a2enmod deflate" | |
#2) add this inside <VirtualHost> section of your Apache configuration | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} ^[0-9]{10}$ | |
RewriteRule ^(.*)$ /add_expires_header%{REQUEST_URI} [QSA] | |
<Directory "/home/user/apps/myapp/current/public/add_expires_header"> | |
ExpiresActive On |
This file contains 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
def index | |
@${1:things} = ${2:Thing}.find :all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.xml { render :xml => @$1 } | |
end | |
end | |
def show |
This file contains 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
snippet: | |
<%= t('${1:path}')%> | |
activation: | |
[tab trigger] trans | |
scope selector: | |
text.html.ruby, text.haml |