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
| #!/usr/bin/env zsh | |
| # | |
| # Works best with blinking text; the last heart will blink | |
| # when you have less than 25% of your battery life remaining. | |
| BATTERY="$(pmset -g ps | tail -1 | perl -pe 's/.*?(\d+)%.*/\1/')" | |
| if [[ $BATTERY -lt 25 ]]; then | |
| echo "\e[5;31m♥\e[0;31m♡♡\e[0m" | |
| elif [[ $BATTERY -lt 50 ]]; then |
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
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
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
| # Minitest and Rspec will need separate environments because both gems define 'describe' | |
| # 'm' is a nice test runner gem. It lets you run 'm test/models/foo.rb:21' | |
| # Gemfile | |
| group :minitest do | |
| gem 'minitest-rails' | |
| gem 'minitest-rails-capybara' | |
| gem 'factory_girl_rails' | |
| gem 'm' |
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
| #Deploy and rollback on Heroku in staging and production | |
| task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
| namespace :deploy do | |
| PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
| STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
| task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
| task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
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
| # Clone rbenv into ~/.rbenv | |
| git clone [email protected]:sstephenson/rbenv.git ~/.rbenv | |
| # Add rbenv to your PATH | |
| # NOTE: rbenv is *NOT* compatible with rvm, so you'll need to | |
| # remove rvm from your profile if it's present. (This is because | |
| # rvm overrides the `gem` command.) | |
| echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile | |
| exec $SHELL |
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
| App = Ember.Application.create({}); | |
| App.loginController = Ember.Object.create({ | |
| // do login stuff | |
| }); | |
| App.LoginFormView = Ember.View.extend({ | |
| login: null, | |
| password: null, |