const compose = (...fns) =>
fns.reduceRight((prevFn, nextFn) =>
(...args) => nextFn(prevFn(...args)),
value => value
);
/* global gapi */ | |
const API_KEY = 'YOURAPIKEYHERE'; | |
import React, { Component } from 'react'; | |
class App extends Component { | |
loadYoutubeApi() { | |
const script = document.createElement("script"); |
We need to generate a unique SSH key for our second GitHub account.
ssh-keygen -t rsa -C "your-email-address"
Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY
. In my case, I've saved the file to ~/.ssh/id_rsa_work
.
{ | |
"added_words": | |
[ | |
"Tabulaciones", | |
"tabulación", | |
"Inicializa", | |
"Apache", | |
"3rn3st0" | |
], | |
"caret_extra_bottom": 3, |
Either you use .babelrc
to specify environment specific settings
(plugins or transforms for example) using the env
key:
{
"presets": ["es2015", "stage-0", "react"],
"env": {
"development": {
"plugins": [
["transform-object-rest-spread"],
["transform-react-display-name"],
Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server
and BrowserSync we can fix this:
npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server
BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.
-
Install the React Developer Tools Chrome Extension.
-
Go to the egghead website, i.e. Getting Started with Redux
-
Click
View -> Developer -> Javascript Console
, then theReact
tab, then the<NextUpLessonList ...>
tag. -
Click back to the
Console
tab, then run:
/** | |
* Function bind polyfill | |
* https://github.com/ariya/phantomjs/issues/10522 | |
*/ | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (context /* ...args */) { | |
var fn = this; | |
var args = Array.prototype.slice.call(arguments, 1); |
// Standard horizontal list, using word-spacing trick to remove whitespace | |
// between inline-block elements. | |
@mixin horizontal-list { | |
padding: 0; | |
text-align: center; | |
word-spacing: -1em; | |
display: table; | |
width: 100%; | |
li { |
<html> | |
<body> | |
<form action="/upload" enctype="multipart/form-data" method="post"> | |
<input type="text" name="title"> | |
<input type="file" name="file"> | |
<input type="submit" value="Upload"> | |
</form> | |
</body> | |
</html> |