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
FAQ for CSS Framework (http://gist.github.com/113972) | |
1. How are you using the "classes" var in JavaScript template? | |
Often, you need to make some manipulations with DOM objects. We almost don't use ids (#blabla) by our Law, only if this is really necessary for improving performance (if this is bottle-neck). But mostly, we use classes. I suggest to avoid using inline classes (because refactoring here is very often, and we often need to change name of classes), but use classes variable instead. E.g. use: | |
var classes = { some_class: 'b-something_some-class' }; | |
$('.' + classes.some_class).hide(); | |
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
FAQ for CSS Framework (http://gist.github.com/113972) | |
1. How are you using the "classes" var in JavaScript template? | |
Often, you need to make some manipulations with DOM objects. We almost don't use ids (#blabla) by our Law, only if this is really necessary for improving performance (if this is bottle-neck). But mostly, we use classes. I suggest to avoid using inline classes (because refactoring here is very often, and we often need to change name of classes), but use classes variable instead. E.g. use: | |
var classes = { some_class: 'b-something_some-class' }; | |
$('.' + classes.some_class).hide(); | |
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
# == css_js_generator | |
# | |
# It generates one big file from all CSS and from all JS small files. It | |
# scans public/stylesheets and public/javascripts, gets all files from there | |
# and creates application.css and application.js). Order can be specified | |
# in css_js_generator.rb. There are also 'notifier' script, it uses | |
# inotifywatch program for tracking changes in public directory and running | |
# css_js_generator.rb after every change in public directory. So, big files | |
# will be generated automatically and you don't need to run it | |
# css_js_generator.rb after every change of files in public dir. |
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
#!/bin/bash | |
current_dir=`pwd` | |
heroku_dir="${current_dir}_heroku" | |
function rsync_repo { | |
# Add trailing slash to source directory to avoid recreating it into $heroku_dir | |
rsync -r --exclude .git/ ${current_dir}/ $heroku_dir | |
} |
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
File.open("lang/ui/en-US.yml") do |file| | |
while line = file.gets | |
sym, translate = line.split(":", 2) | |
Dir['app/views/*/**', 'app/controllers/*', 'app/helpers/*'].each do |path| | |
lines = "" | |
File.open( path ) do |f| | |
lines = f.readlines | |
end | |
NewerOlder