This file contains hidden or 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 {isNil} from 'ramda'; | |
export function dispatch(...funcs) { | |
return function(...args) { | |
for (let fun of funcs) { | |
let ret = fun(...args); | |
if (!isNil(ret)) return ret; | |
} |
This file contains hidden or 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 myFunction() { | |
var senderEmail = "[email protected]"; | |
var threads = GmailApp.search("from:"+senderEmail); | |
for (var i = 0; i < threads.length; i++) { | |
Gmail.Users.Messages.remove('me', threads[i].getId()); | |
} | |
} |
This file contains hidden or 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
// DESTRUCTURING | |
// http://www.2ality.com/2015/01/es6-destructuring.html | |
let obj = { first: 'Jane', last: 'Doe' }; | |
let { first: f, last } = obj; | |
// f = 'Jane'; last = 'Doe' |
This file contains hidden or 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 { Map } from 'immutable'; | |
const items = Map({ | |
id1: Map({ | |
name: 'Item Name', | |
isActive: true |
This file contains hidden or 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 reduce(input, transformator, initialValue = null) { | |
let response = new Map(initialValue); | |
for (kv of input.entries()) { | |
response = transformator((result, [key, value]) => { | |
return result.set(key, value); | |
})(response, kv) |
This file contains hidden or 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
BucketActions.createBucket( | |
initValue | |
); | |
// > bucketID | |
BucketActions.addToBucket( | |
bucketID, | |
value | |
); | |
// > true |
This file contains hidden or 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
html { | |
-ms-text-size-adjust: 100%; | |
-webkit-text-size-adjust: 100%; | |
} | |
body { | |
margin: 0; | |
font: 16px/1 sans-serif; | |
-moz-osx-font-smoothing: grayscale; | |
-webkit-font-smoothing: antialiased; | |
} |
This file contains hidden or 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 CustomEditor() { | |
... | |
return ( | |
<Editor | |
editorState={editorState} | |
onChange={onChange} | |
blockStyleFn={myBlockStyleFn} | |
handleReturn={createHandleReturn(editorState, onChange)} |
This file contains hidden or 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
https://gist.github.com/joshdover/7c5e61ed68cc5552dc8a25463e357960 | |
https://github.com/jpuri/react-draft-wysiwyg/blob/master/js/src/components/Controls/TextAlign/index.js |
This file contains hidden or 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
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |