(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.
(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.
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
| { | |
| "vars": { | |
| "@gray-darker": "lighten(#000, 13.5%)", | |
| "@gray-dark": "lighten(#000, 20%)", | |
| "@gray": "lighten(#000, 33.5%)", | |
| "@gray-light": "lighten(#000, 46.7%)", | |
| "@gray-lighter": "lighten(#000, 93.5%)", | |
| "@brand-primary": "#428bca", | |
| "@brand-success": "#5cb85c", | |
| "@brand-info": "#5bc0de", |
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
| import React from 'react'; | |
| import { shallow } from 'enzyme'; | |
| import MyComponent from '../src/my-component'; | |
| const wrapper = shallow(<MyComponent/>); | |
| describe('(Component) MyComponent', () => { | |
| it('renders without exploding', () => { | |
| expect(wrapper).to.have.length(1); | |
| }); |
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:
| #!/bin/bash | |
| set -e | |
| # changes color of info and then resets back to default | |
| function info { | |
| tput setaf 6; echo $1; tput sgr0 | |
| } | |
| # install from brew if not already installed |
| import React, {Component, PropTypes} from 'react' | |
| import {Link, Route as OrigRoute, Switch, Redirect, BrowserRouter as Router, withRouter} from 'react-router-dom' | |
| // Subscribes a child to history updates, passing the current location as a prop | |
| // This is needed to work around the React context API not updating all children | |
| // See https://github.com/ReactTraining/react-router/issues/4629#issuecomment-284218493 | |
| export class LocationListener extends Component { | |
| static contextTypes = { | |
| history: PropTypes.object, | |
| } |
| mkdir ~/vim | |
| cd ~/vim | |
| # Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
| # Compiled on Jul 20 2017 | |
| curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz | |
| export VIMRUNTIME="$HOME/vim/runtime" | |
| export PATH="$HOME/vim:$PATH" | |
| cd - |