Cheat sheet extracted from https://www.youtube.com/watch?v=2zmUSoVMyRU by That JS Dude.
If you pass any of the CSS selectors to $(<identifier>)
you get the first element.
> $('a')
$(document).ready(function() { | |
//init tab history with default tab 'table' | |
$(window).tabHistory('table'); | |
}); |
web: bundle exec unicorn -c vendor/plugins/zachp-local/unicorn.rb | |
guard: bundle exec guard start --no-interactions | |
job: bundle exec script/delayed_job run > /dev/null | |
mail: bundle exec mailtrap run |
Cheat sheet extracted from https://www.youtube.com/watch?v=2zmUSoVMyRU by That JS Dude.
If you pass any of the CSS selectors to $(<identifier>)
you get the first element.
> $('a')
<!doctype html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="bower_components/qunit/qunit/qunit.css"> | |
<div id="qunit"></div> | |
<div id="qunit-fixture"></div> | |
<script src="bower_components/jquery/jquery.js"></script> | |
<script src="bower_components/handlebars/handlebars.js"></script> | |
<script src="bower_components/ember/ember.js"></script> |
namespace :db do | |
namespace :migrate do | |
desc "runs db:drop db:create db:migrate for both development and test environments" | |
task :reset_all do | |
system('bundle exec rake db:migrate:reset') | |
system('bundle exec rake db:migrate:reset RAILS_ENV=test') | |
end | |
end | |
end |
MyComponent = React.createClass | |
# give your component a DisplayName that is equal to it's file name. | |
# it is helpful so you dont just see <<anonymous>> when react prints | |
# warnings in the console or <Undefined> in the react inspector. | |
displayName: 'MyComponent' | |
# propTypes should be the second thing, after your DisplayName | |
propTypes: | |
# then put the rest of the react specific properties, in this order |
var EventEmitter = require('events').EventEmitter; | |
var mergeInto = require('react/lib/mergeInto'); | |
module.exports = createStore; | |
function createStore(initialState) { | |
var events = new EventEmitter(); | |
var state = initialState || {}; | |
return { |
Run rails new --help
to view all of the options you can pass to rails new
:
$ bin/rails new --help
Usage:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/eliot/.rbenv/versions/2.2.0/bin/ruby
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y --force-yes install make unzip g++ libssl-dev git xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps clang libdbus-1-dev libgtk2.0-dev libnotify-dev libgnome-keyring-dev libgconf2-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib | |
npm -f init | |
npm i -S nightmare | |
xvfb-run nodejs index.js |
module ArelHelpers | |
extend self | |
def self.included(base) | |
base.extend self | |
end | |
def asterisk(arel_table_or_model) | |
arel_table, columns = case arel_table_or_model | |
when Arel::Table |