$ rails g model User
belongs_to
has_one
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
| const getSecret = (secret) => { | |
| return { | |
| get: () => secret | |
| }; | |
| }; | |
| test('Closure for object privacy.', assert => { | |
| const msg = '.get() should have access to the closure.'; | |
| const expected = 1; | |
| const obj = getSecret(1); |
| # Migration generator shortcuts. | |
| # rails generate migration MyNewMigration | |
| # rails generate migration add_fieldname_to_tablename fieldname:string | |
| # rails generate model Product name:string description:text | |
| # The set of available column types [:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date, :binary, :boolean] | |
| # A migration is a subclass of ActiveRecord::Migration. You must implement the "up" and "down" (revert) methods. | |
| # These are the handy methods available to a Migration: |
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| /* | |
| * From css-tricks.com | |
| * http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ | |
| */ | |
| /* Smartphones (portrait and landscape) ----------- */ | |
| @media only screen | |
| and (min-device-width : 320px) | |
| and (max-device-width : 480px) { | |
| /* Styles */ |