View build-atom.sh
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
#!/bin/sh | |
ATOM_CHANNEL="${ATOM_CHANNEL:=stable}" | |
echo "Downloading latest Atom release on the ${ATOM_CHANNEL} channel..." | |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then | |
curl -s -L "https://atom.io/download/mac?channel=${ATOM_CHANNEL}" \ | |
-H 'Accept: application/octet-stream' \ | |
-o "atom.zip" | |
mkdir atom |
View emojis.js
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
// Go to "Customize Slack" in settings. It'll redirect you to https://[organization].slack.com/customize/emoji | |
// Then run this code in the web terminal. | |
{ | |
let total = 0; | |
const contributors = Object.entries([].slice.call(document.querySelectorAll('#custom_emoji a')).reduce((prev, link) => { | |
total += 1; | |
if (!prev[link.innerText]) { | |
return { | |
...prev, |
View controller.js
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
var myApp = angular.module('myApp',[]); | |
myApp.controller('MyCtrl', function($scope, TodoService) { | |
function addTodo($scope, TodoService) { | |
return function curriedAddTodo(title, description) { | |
$scope.title = ''; | |
$scope.description = ''; | |
$scope.todos = TodoService.todosReducer( | |
$scope.todos, |
View factory.js
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(app) { | |
function TodoServiceFactory() { | |
var ADD_TODO = 'ADD_TODO'; | |
var REMOVE_TODO = 'REMOVE_TODO'; | |
var ID = -1; | |
function findIndex(haystack, needle) { | |
var isFound = false; | |
var index = -1; | |
haystack.some(function mapHaystack(data) { |
View build-package.sh
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
#!/bin/sh | |
ATOM_CHANNEL="${ATOM_CHANNEL:=stable}" | |
echo "Downloading latest Atom release on the ${ATOM_CHANNEL} channel..." | |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then | |
curl -s -L "https://atom.io/download/mac?channel=${ATOM_CHANNEL}" \ | |
-H 'Accept: application/octet-stream' \ | |
-o "atom.zip" | |
mkdir atom |
View DynamicRenderImplementation.jsx
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, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import Translate from './highOrderComponents/WithTranslate'; | |
import ClickOutside from './highOrderComponents/ClickOutside'; | |
import WithUser from './highOrderComponents/WithUser'; | |
import { | |
configureUser, | |
} from './store/actions'; |
View TranslateDynamicRenderComponent.jsx
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, { Component } from 'react'; | |
import reduce from 'lodash/reduce'; | |
const TRANSLATIONS = { | |
US: { | |
welcome: 'Welcome {{user}}', | |
}, | |
MX: { | |
welcome: 'Bienvenido {{user}}', | |
}, |
View TranslateHighOrderComponent.jsx
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, { Component } from 'react'; | |
import { | |
translateFromCountry, | |
} from './translate'; | |
// High order Component translate | |
const translate = (WrappedComponent) => { | |
return class extends Component { | |
translate = (key, params) => { |
View HighOrderComponentsProblemsExample.jsx
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, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import { recompose } from 'recompose'; | |
import translate from './highOrderComponents/withTranslate'; | |
import clickOutside from './highOrderComponents/clickOutside'; | |
import withUser from './highOrderComponents/withUser'; | |
import { | |
configureUser, | |
} from './store/actions'; |