This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children; | |
const Header = ({shouldLinkToHome}) => ( | |
<div> | |
<ConditionalWrap | |
condition={shouldLinkToHome} | |
wrap={children => <a href="/">{children}</a>} | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
var React = require("react") | |
var Immutable = require("immutable") | |
// In order to use any type as props, including Immutable objects, we | |
// wrap our prop type as the sole "data" key passed as props. | |
type Component<P> = ReactClass<{},{ data: P },{}> | |
type Element = ReactElement<any, any, any> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create an ActionQueue and dispatch each synchronously | |
* @author tgroshon | |
* | |
* See an alternate implementation using ASync from | |
* https://github.com/facebook/flux/issues/106 | |
* by fabiozaffani | |
*/ | |
import {Dispatcher} from 'flux' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# CREAR UN REPOSITORIO EN GITHUB DESDE LA TERMINAL ############################ | |
############################################################################### | |
############################################################################### | |
# Crear el repositorio en Github (Github API v3) | |
curl -u '<user>' https://api.github.com/user/repos -d '{ "name": "<repository>" }' | |
# Añadir el repositorio remoto de Github a nuestro repositorio local | |
git remote add origin [email protected]:<user>/<repository>.git | |
# Añadimos todos los cambios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# References: | |
# https://help.github.com/articles/generating-ssh-keys/ | |
# https://help.github.com/articles/working-with-ssh-key-passphrases/ | |
############################################################################### | |
# 1. Check for SSH keys | |
############################################################################### | |
# List the files in your .ssh directory, if they exist | |
ls -al ~/.ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[].filter.call(document.querySelectorAll('.color-group .color'), function(el) { | |
return el.querySelector('.shade').textContent === 'A400'; | |
}).map(function (el) { | |
return el.querySelector('.hex').textContent; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function numerical_int(dx, y_array) { | |
var maxy = Math.max.apply(null, y_array); | |
var dy_array = y_array.map(function(num) { | |
return Math.abs(maxy - num); | |
}); | |
var profile_integral = 0; | |
var n = dy_array.length; | |
for (i = 1; i < n; i++) { | |
var dy_init = dy_array[i - 1]; | |
var dy_end = dy_array[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# EMPEZANDO ################################################################### | |
############################################################################### | |
# Configurar email y nombre | |
git config --global user.name "John Doe" | |
git config --global user.email "[email protected]" | |
# Crear un nuevo repositorio | |
git init |
NewerOlder