by alexander white ©
| { | |
| init: function (elevators, floors) { | |
| function queueDestinationForElevator(elevator, floorNum) { | |
| if (elevator.destinationQueue.length) { | |
| if (isElevatorGoingUp(elevator)) { | |
| if (floorNum < elevator.destinationQueue[0]) { | |
| if (elevator.currentFloor() < floorNum) { | |
| elevator.destinationQueue.splice(0, 0, floorNum); | |
| } else { |
| class PrimeFactorizer | |
| attr_reader :number | |
| def initialize(number) | |
| check_argument(number) | |
| @number = number | |
| end | |
| def factors |
| # ~/.tmuxinator/mertis.yml | |
| name: pipeline_develop | |
| root: ~/ | |
| post: tmux select-window -t :scosreader | |
| # Optional tmux socket | |
| # socket_name: foo | |
| # Runs before everything. Use it to start daemons etc. |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
emacs --daemon to run in the background.
emacsclient.emacs24 <filename/dirname> to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
- Undo -
C-/ - Redo -
C-? - Change case: 1. Camel Case :
M-c2. Upper Case :M-u
- Lower Case :
M-l
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
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
| # Mina Deploy | |
| # =========== | |
| # | |
| # Adapted from Creative deploy stack in Manabalss v4, Mar.2015, updated to support staging on Jun.2015 | |
| # On first deploy do: mina setup --verbose | |
| # Then do : mina deploy[initialize] --trace | |
| # | |
| # Usage examples: | |
| # mina deploy[soft,seed,compile] to=staging # deploy task with all options | a simple `mina deploy` will deploy to production | |
| # mina rake[db:seed] # for multi-argument tasks # mina 'rake[payments:refund[arg1\,arg2]]' |