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
rvm use [version]@[directory] --create --rvmrc |
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
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function | |
export PATH=/usr/local/bin:$PATH # Postgres installed via homebrew on os x lion fix | |
export PGDATA=/usr/local/var/postgres # Postgresql cluster variables | |
export CI_TSDIR=$PGDATA # Postgresql cluster variables | |
export CLICOLOR=1 | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx | |
export PATH=$PATH:~/Documents/ci_git/git_support/bin |
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
Factory girl is an object factory library to be used with your tests. | |
Installation: | |
$ [sudo] gem install factory_girl | |
or with Rails >2.1 dependency management, add to environment.rb | |
config.gem "factory_girl", :lib => false | |
Then add: |
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
>< (?<=\>)(.*?)(?=\<) |
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
number.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); |
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
require 'uglifier' | |
module BookmarkletHelper | |
def get_bookmarklet(file, hash) | |
js = File.open( "#{Rails.root}/app/assets/javascripts/#{file}", 'r' ).read | |
js = Uglifier.compile(js, :mangle => false, :comments => :none) | |
js_vars.each_pair do |k, v| | |
js.gsub!("{{#{k.to_s}}}", v) |
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 Singleton | |
_instance = undefined # Must be declared here to force the closure on the class | |
@get: (args) -> # Must be a static method | |
_instance ||= new _Singleton args |
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
#overwite the accessor for a field on a model if empty | |
def start_date | |
self[:start_date] || 1.month.ago.strftime("%Y%m%d") | |
end |
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
Tag.where 'lower(name) LIKE :search', :search => "%#{search_term}%".downcase |
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
// While you can edit this file, it's best to put your changes in | |
// "User/Preferences.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for | |
// example, in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform |
OlderNewer