#create a seession
screen -S sessionname
screen -d -R sessionname
. | |
├── actions | |
├── stores | |
├── views | |
│ ├── Anonymous | |
│ │ ├── __tests__ | |
│ │ ├── views | |
│ │ │ ├── Home | |
│ │ │ │ ├── __tests__ | |
│ │ │ │ └── Handler.js |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger
A not politically correct assertion of my feelings towards a piece of software:
Note: Repetition builds cynicism, asset_sync
isn't bad, but when an asset problem cannot be solved via support it gets escalated to me. Often times someone using asset_sync
the problem is due to their use of the library and not from Heroku.
The asset sync gem uploads your assets (images, css, javascript) to S3. From there you can either point browsers to the copy on S3 or use a CDN + the S3 bucket. It's a good idea, and solved a problem at one time.
It is no longer needed and you should now use https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn instead. So rather than copying your assets over to S3 after they are precompiled the CDN grabs them from your website instead. Here's some reasons why it's better.
{ | |
"directory": "vendor/assets/components" | |
} |
Here are the steps on how to get MySQL working with MAMP and Rails Projects: | |
Note: If you already have MAMP installed and you update the mysql2 gem, you'll need to run steps 4-6 to change the gem version that is linked to MAMP. | |
1.) Download and install MAMP (if it's not already installed) - http://www.mamp.info/downloads/releases/MAMP_PRO.zip | |
2.) Add these lines to your .bash_profile file. Be sure to remove any existing lines that reference MAMP. | |
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH | |
export PATH="/Applications/MAMP/Library/bin:$PATH" |
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |
desc "convert a latin1 database with utf8 data into proper utf8" | |
task :convert_to_utf8 => :environment do | |
puts Time.now | |
dryrun = ENV['DOIT'] != '1' | |
conn = ActiveRecord::Base.connection | |
if dryrun | |
def conn.run_sql(sql) | |
puts(sql) | |
end | |
else |