in OS X 10.4 to macOS sierra 10.12 and maybe higher!
Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:
# this block is in alphabetic order | |
caarlos0/git-add-remote kind:path | |
caarlos0/jvm | |
caarlos0/ports kind:path | |
caarlos0/zsh-git-fetch-merge kind:path | |
caarlos0/zsh-git-sync kind:path | |
caarlos0/zsh-mkc | |
caarlos0/zsh-open-pr kind:path | |
mafredri/zsh-async | |
Tarrasch/zsh-bd |
in OS X 10.4 to macOS sierra 10.12 and maybe higher!
Copy this entire code block and paste it into your terminal and push Return to create this file for you with correct permissions. It will (probably) ask for your password:
/** | |
* Loads javascript file by url and saves reference to it by name, so it's not loaded again | |
* @param {string} name Name of js library | |
* @param {string} url Url to js library | |
* @return {promise} Resolves when library is loaded | |
* | |
* Based on example by Brad Berger: https://bradb.net/blog/promise-based-js-script-loader/ | |
* Extended w/ global variable to keep track of previously loaded scripts. | |
* Removed support for loading several independent scripts at once via Promise.all() | |
* |
Update: https://www.cyanhall.com/posts/notes/7.homebrew-cheatsheet/#java
on El Capitan, after installing the brew...
$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java
And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/
var ModuleParserHelpers = require('webpack/lib/ModuleParserHelpers'); | |
var NullFactory = require('webpack/lib/NullFactory'); | |
var _ = require('lodash'); | |
var path = require('path'); | |
var sass = require('node-sass'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var ExtractTextPlugin__dirname = path.dirname( | |
require.resolve('extract-text-webpack-plugin')); | |
var visited = {}; |
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var path = require('path'); | |
var folders = { | |
APP: path.resolve(__dirname, '../app'), | |
BUILD: path.resolve(__dirname, '../build'), | |
BOWER: path.resolve(__dirname, '../bower_components'), | |
NPM: path.resolve(__dirname, '../node_modules') | |
}; |
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 {