MySQL Dumping Cheat-Sheet
Make a quick dump of a mysql database: mysql_dump db_name > backup-file.sql You can then read that dump file back into the server like this mysql db_name < backup-file.sql or…
Succeed with Automated Testing and TDD
Make a quick dump of a mysql database: mysql_dump db_name > backup-file.sql You can then read that dump file back into the server like this mysql db_name < backup-file.sql or…
operand what it does shift position of bits in Bignum and Fixnum ~ bitwise NOT (high-presendence) & bitwise AND (medium-presendence) | bitwise OR (medium-presendence) ^ bitwise XOR (medium-presendence) ** exponent…
Go to script/console to open ruby in interactive mode. script/console loads your environments (everything in environment.rb and all your plugin and gem initializers), so you basically have access to all…
Using Mac ports sudo port install ImageMagick If you have an existing ImageMagick installed, you will get this error: Error: Target org.macports.activate returned: Image error: Another version of this port…
1) be sure to put in your environment file (inside your initializer) config.gem “paperclip” 2) make sure your form_form has multipart set to true like this: { :multipart => true…
Sometimes you’re in script/console and you make a change to your model files, but since Ruby on reads the models when the environment loads, your change isn’t reflected right away…
logger.debug WHAT_TO_OUTPUT ***** I think this syntax only works in controllers and outside of a controller you have to use rails_default_debugger ****** (where WHAT_TO_OUTPUT is a string or interpolated to…
A method defined on a model that ends with = is an assignment method, so when ActiveRecord is trying to save an attribute to this model, you can define a…
When running Passenger (module for running Rails on Apache), the console log (output from puts) goes into the apache error log (see /var/log/apache2/error_log)