(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| const model = %yourSequelizeModel% | |
| for (let assoc of Object.keys(model.associations)) { | |
| for (let accessor of Object.keys(model.associations[assoc].accessors)) { | |
| console.log(model.name + '.' + model.associations[assoc].accessors[accessor]+'()'); | |
| } | |
| } |
| #EXTM3U | |
| #EXTINF:-1,Digitally Imported - Ambient | |
| http://pub1.diforfree.org:8000/di_ambient_hi | |
| #EXTINF:-1,Digitally Imported - Big Room House | |
| http://pub1.diforfree.org:8000/di_bigroomhouse_hi | |
| #EXTINF:-1,Digitally Imported - Breaks | |
| http://pub1.diforfree.org:8000/di_breaks_hi |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| SELECT * | |
| FROM | |
| ( | |
| SELECT 'juan' AS data UNION | |
| SELECT 'carlos' AS data UNION | |
| SELECT 'pepito' AS data UNION | |
| SELECT 'mauro' AS data | |
| ) AS tmp_names | |
| WHERE | |
| -- Compare data with a real table |
| cat /etc/redhat-release #will show you information for red hat based distros. | |
| cat /etc/SuSE-release #for SUSE based distros. | |
| cat /etc/mandrake-release #for mandrake distros. | |
| cat /etc/debian_version #for debian based distros. | |
| cat /etc/UnitedLinux-release #might also return some more information. |
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
| require 'carrierwave/processing/mini_magick' | |
| class ImageUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
| DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
| def store_dir | |
| "files/#{model.id}" |
| # Gemfile | |
| … | |
| gem 'uuidtools' | |
| … |
| /* | |
| Load Sinon.JS in the SpecRunner: | |
| <script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script> | |
| <script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script> | |
| <script type="text/javascript" src="sinon-1.0.0.js"></script> | |
| <script type="text/javascript" src="sinon-ie-1.0.0.js"></script> | |
| http://cjohansen.no/sinon/ | |
| */ |
| require "mysql_big_table_migration_helper" | |
| class AddIndexOnSomeColumnToSomeTable < ActiveRecord::Migration | |
| extend MySQLBigTableMigrationHelper | |
| def self.up | |
| add_index_using_tmp_table :some_table, :some_column | |
| end |