This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d | |
- from https://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore |
#put in lib/tasks/fixtures.rake | |
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML test fixtures from data in an existing database. | |
Defaults to development database. Set RAILS_ENV to override.' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_migrations"] | |
ActiveRecord::Base.establish_connection(:development) | |
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
https://twitter.com/stefanpenner/status/466570444246884352 | |
upgrade protip: | |
1. cd your-project | |
2. npm update ember-cli —save | |
3. ember init | |
4. use “d” to view diffs | |
5. git to adjust overwrites |
namespace :breakpointapp do | |
desc 'Prints emails for sample users to the console' | |
task :user_info => [:environment] do | |
unless Rails.env.development? | |
raise 'This task can only be run in the development environment' | |
end | |
puts User.pluck(:email) | |
end | |
end |
var User = DS.Model.extend({ | |
name : DS.attr('string'), | |
email : DS.attr('string'), | |
creationDate : DS.attr('date') | |
}); | |
User.reopenClass({ | |
FIXTURES: [ | |
{ | |
id: "1", |
Ember.run -> | |
getApplicationController().unauthenticate() | |
$.removeCookie("auth_user") | |
$.removeCookie("access_token") |
To have launchd start mongodb at login: | |
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents | |
Then to load mongodb now: | |
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
Or, if you don't want/need launchctl, you can just run: | |
mongod |
ls -l -t | tail -n +2 | head -10 |
watchdog('module name', 'message information' . var_export($var, TRUE), WATCHDOG_INFO); |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer