start new:
tmux
start new with session name:
tmux new -s myname
| namespace :deploy do | |
| desc 'Bundle and minify the JS and CSS files' | |
| task :precache_assets, :roles => :app do | |
| root_path = File.expand_path(File.dirname(__FILE__) + '/..') | |
| jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first | |
| yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first | |
| assets_path = "#{root_path}/public/assets" | |
| # Precaching assets | |
| run_locally "ruby -I#{yui_lib_path} #{jammit_path}" |
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |
| User.find(1).flag Tablet.find(1) | |
| # => #<MakeFlaggable::Flagging id: 1, flaggable_type: "Device", flaggable_id: 1, flagger_type: "User", flagger_id: 1, reason: nil, created_at: "2012-05-30 16:16:23", updated_at: "2012-05-30 16:16:23"> | |
| User.find(1).flagged? Tablet.find(1) | |
| # MakeFlaggable::Flagging Load (0.4ms) SELECT "flaggings".* FROM "flaggings" WHERE "flaggings"."flagger_id" = 1 AND "flaggings"."flagger_type" = 'User' AND "flaggings"."flaggable_type" = 'Tablet' AND "flaggings"."flaggable_id" = 1 LIMIT 1 | |
| # => false | |
| # :rage: | |
| ######### | |
| # If you look at the query, it inserted the `flaggable_type` as 'Device', but is searching for 'Tablet' |
| <html> | |
| <head> | |
| <meta http-equiv="X-UA-Compatible" content="IE=8" /> | |
| <title>Batman Profiler</title> | |
| <script type="text/javascript" src="https://raw.github.com/Shopify/batman/master/lib/es5-shim.js"></script> | |
| <script type="text/javascript" src="https://raw.github.com/Shopify/batman/v0.9.0/lib/batman.js"></script> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js"></script> | |
| <script type="text/javascript" src="http://coffeescript.org/extras/coffee-script.js"></script> | |
| <script src="http://code.highcharts.com/highcharts.js"></script> |
| # config/deploy.rb | |
| # probably a lot of ways to improve this... | |
| set :application, 'my_app' | |
| set :repo_url, '[email protected]:USERNAME/my_app.git' | |
| # should set up a deploy user | |
| set :user, 'deploy' | |
| set :deploy_to, '/var/www/my_app' | |
| set :scm, :git |