Firstly install Brew on your MAC
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install PHP
- brew update
- brew tap homebrew/dupes
- brew tap homebrew/php
- brew install php56
/** | |
* Primitive load-balancer to split Cypress specs across multiple runners. This script assumes that | |
* all your specs are in the folder '<project root>/cypress/integration'. It uses the number of | |
* tests per spec file as sole criteria to split specs between runners. | |
* | |
* This script accepts two arguments: the total number of runners and the index (starting from 0) of | |
* the current runner. Example: | |
* $ node cypress-partial.js 5 2 | |
* This command asks for specs to give to the third runner of five runners. | |
* The output of the script is a coma-separated list of specs that can be given to Cypress. Example: |
Accounts.onCreateUser((options, user) => { | |
user.city = null; | |
user.networks = []; | |
user.attending = []; | |
if (user.profile == null) { | |
user.profile = {}; | |
} | |
if (user.services != null) { | |
var service = _.keys(user.services)[0]; |
Firstly install Brew on your MAC
Then install PHP
[ | |
{ | |
"offset": "GMT-12:00", | |
"name": "Etc/GMT-12" | |
}, | |
{ | |
"offset": "GMT-11:00", | |
"name": "Etc/GMT-11" | |
}, | |
{ |
[ | |
{ | |
"value":"International Date Line West", | |
"name":"(GMT-11:00) International Date Line West" | |
}, | |
{ | |
"value":"Midway Island", | |
"name":"(GMT-11:00) Midway Island" | |
}, | |
{ |
<template name="openModal"> | |
<button class="button" {{bind 'openModal: myModalTemplate'}}>Open modal</button> | |
</template> |
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () { | |
try { | |
return Boolean(new Blob()); | |
} catch (e) { | |
return false; | |
} | |
}()); | |
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () { | |
try { |
// Timezone library | |
var moment = require("moment-timezone"); | |
// Later | |
var later = require("later"); | |
// The schedule we would like to support: | |
var sched = later.parse.text("at 17:00"); | |
// In March CET switches to CEST (daylight saving) so this is a nice example | |
var timezone = "Europe/Amsterdam"; |
TLDR: a React component should either manage its own state, or expose a callback so that its parent can. But never both.
Sometimes our first impulse is for a component to entirely manage its own state. Consider this simple theater seating picker that has a letter for a row, and a number for a seat. Clicking the buttons to increment each value is hardly the height of user-interface design, but never mind - that's how it works:
/* @flow */
var React = require('react');
var Letter: React.ReactClass = React.createClass({
getInitialState: function(): any {
namespace('App.data') | |
### | |
Meteor pagination class | |
Usage | |
UsersController = RouteController.extend | |
waitOn: -> | |
@page = @params.query.page || 1 | |
@pagination = new App.data.Pagination(Users, selector, {page: @page}) |