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
puts header_strings.split(" | ").map { |word| "-" * word.size }.join " | " |
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
if [[ -n $(git ls-files --other --exclude-standard) ]]; | |
then | |
echo "commit aborted, there are untracked files!" | |
exit 1 | |
else | |
exit 0 | |
fi |
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
- show ||= 'cards' | |
= div_for user, class: "user-#{show}" do | |
- if show == 'list' | |
.user-description | |
.user-avatar | |
= avatar(user, class: "user-img") | |
.user-info | |
= link_to user.name, "", class: "name" | |
%p.role= user.role_name |
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 run_cmd(cmd) | |
cmd_output = `#{cmd}` | |
if $?.to_i.zero? | |
true | |
else | |
puts cmd_output | |
false | |
end | |
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
before { run "cd ~/code/rails_blank_app" } | |
run "echo -e \"\\033];rails_blank_app\\007\"" | |
run "git st" | |
tab :name => "vim" do | |
run "echo -e \"\\033];vim\\007\"" | |
run "vim ." | |
end |
- Efficient Rails, Andrew Allen
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
in a newly created Rails 3.1.0.rc5 application: | |
$ time bundle _1.0.15_ install | |
Fetching source index for http://rubygems.org/ | |
[...] | |
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
real 0m39.081s | |
user 0m34.663s | |
sys 0m0.632s |
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
#!/usr/bin/env ruby | |
# a script to launch commands in differents iTerm tabs for a Rails project: console, server, mate... | |
# inspired by http://github.com/chrisjpowers/iterm_window examples | |
# examples: | |
# iterm-rails /path/to/project | |
# iterm-rails project # you can set a default project directory (see configuration options below) | |
# you can override default configuration options: |
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
# flo_template.rb | |
# inspired from http://github.com/jeremymcanally/rails-templates/blob/master/daring.rb | |
# reference for Rails template syntax: lib/rails_generator/generators/applications/app/template_runner.rb | |
# Delete unnecessary files | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm public/javascripts/*" |
NewerOlder