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
git clone [repo-A-url] [repo-A-name] | |
cd [repo-A-name] | |
git checkout [branch-in-repo-A] | |
git remote rm origin | |
git filter-branch --subdirectory-filter [directory-to-move] -- --all | |
mkdir [folder-to-move] | |
mv * [folder-to-move] # mind the hidden files | |
git add --all | |
git commit | |
cd [repo-B-path] |
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
const path = require("path") | |
const fs = require("fs") | |
const endOfLine = require("os").EOL | |
// Config - | |
const fileDir = __dirname | |
const fileName = "in-file.txt" | |
const outFileDir = __dirname | |
const outFileName = "out-file.txt" |
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
// library imports 😜 wink, wink | |
const identity = x => x | |
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))) | |
function process (words, configs) { | |
const lengthFilter = length => word => | |
Array.isArray(length) | |
? word.length >= length[0] && word.length <= length[1] | |
: word.length === length |
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
ActivityIndicator | |
@include: View | |
color: color | |
size: enum('small', 'large'), number | |
Button | |
color: color | |
DatePickerIOS | |
@include: View |
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 linksReducer (state = Map(), action) { | |
switch (action.type) { | |
case CLOSE_LINK: | |
case REMOVE_LINK: | |
return state.delete(action.id) | |
... | |
} | |
} |
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 usersReducer (state = Map(), action) { | |
switch (action.type) { | |
... | |
case REMOVE_USER: | |
return state.delete(action.id) | |
... | |
} | |
} | |
function tasksReducer (state = Map(), action) { |
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
const rootReducer = combineReducers({ | |
user: usersReducer, | |
task: combineReducers({ | |
list: tasksReducer, | |
current: currentTaskReducer | |
}) | |
}) | |
function usersReducer (state = Map(), action) { | |
[...] |
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 tasksReducer (state = Map(), action) { | |
switch (action.type) { | |
case ADD_TASK: | |
return state.set(action.task.id, action.task) | |
case REMOVE_TASK: | |
return state.delete(action.id) | |
case COMPLETE_TASK: | |
return state.updateIn([action.id, 'completed'], true) |
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 { applyMiddleware } from 'redux' | |
import { addAlert } from 'actions/Alert' | |
function errorHandler () { | |
return (next) => (action) => { | |
if (typeof action === 'function') { | |
return next(async function (dispatch, getState) { | |
try { | |
return await action(dispatch, getState) | |
} catch (error) { |
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
env: | |
es6: true | |
browser: true | |
jquery: true | |
ecmaFeatures: | |
jsx: true | |
experimentalObjectRestSpread: true | |
blockBindings: true | |
plugins: | |
- react |
NewerOlder