Monday, December 10, 2012

Listing files in an other branch or commit in Git

git ls-tree -r --name-only BRANCH_OR_COMMIT -- FOLDER
view raw gistfile1.txt hosted with ❤ by GitHub

Wednesday, December 5, 2012

Using Rails.env in SASS

You can add your custom scripts to SASS easily, but make sure the following code loads in your config.rb/application.rb or somewhere along the line.
module Sass::Script::Functions
def development()
Sass::Script::Bool.new(Rails.env.development?)
end
def production()
Sass::Script::Bool.new(Rails.env.production?)
end
end
view raw gistfile1.rb hosted with ❤ by GitHub
and here is how you can use them
@if development() {
}
@if not production() {
}
view raw gistfile1.sass hosted with ❤ by GitHub