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
branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || | |
branch_name="(unnamed branch)" # detached HEAD | |
branch_name=${branch_name##refs/heads/} | |
git checkout master | |
git fetch upstream | |
git merge upstream/master | |
git checkout $branch_name | |
git merge master |
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
let (|>) v f = f v | |
let (<|) f v = f v | |
/* | |
Possible characters: | |
! $ % & * + - . / : < = > ? @ ^ | ~ | |
But they can't all be used freely. | |
Read: http://blog.shaynefletcher.org/2016/09/custom-operators-in-ocaml.html |
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 CryptographyJs = require("./cryptography.js"); | |
CryptographyJs.hash({ algorithm: 'md5', length: 10 }, "asd"); | |
CryptographyJs.hash({ algorithm: 'md5' }, "asd"); | |
CryptographyJs.hash({ length: 10 }, "asd"); | |
CryptographyJs.hash({}, "asd"); |
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
--log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
type: bool default: false | |
--expose_gc (expose gc extension) | |
type: bool default: false | |
--max_new_space_size (max size of the new generation (in kBytes)) | |
type: int default: 0 | |
--max_old_space_size (max size of the old generation (in Mbytes)) | |
type: int default: 0 | |
--max_executable_size (max size of executable memory (in Mbytes)) | |
type: int default: 0 |
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
npm config set init.author.name "Gidi Meir Morris" | |
npm config set init.author.email [email protected] | |
npm config set init.author.url http://www.gidi.io | |
npm config set init.license MIT |
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 romanNumeral = (char, val) => { | |
return { | |
char: char, | |
val: val, | |
isBellow: comp => comp > val, | |
isAbove: comp => comp < val, | |
is: comp => comp === val, | |
times: repeat => { | |
return (new Array(parseInt(repeat))).fill(char).join('') |
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 diffObjects (left, right) { | |
const leftKeys = Object.keys(left) | |
const rightKeys = Object.keys(right) | |
const keyDiff = _.intersection(leftKeys, rightKeys) | |
.reduce((differentKeys, key) => { | |
if(_.isPlainObject(left[key]) && _.isPlainObject(right[key])) { | |
const diff = diffObjects(left[key], right[key]) | |
if(diff !== true) { | |
differentKeys.push(key) |
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 conditional = () => { | |
let elseThen = i => i; | |
const conditions = []; | |
function cond (val) { | |
const res = conditions | |
.find(condPair => condPair.test(val)); | |
return res | |
? res.then(val) | |
: elseThen(val); |
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 */ | |
function Children (children : Iterable<any>) { | |
this.children = Array.from(children) | |
return this | |
} | |
Children.prototype = { | |
toArray () : any[] { | |
return this.children |
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
React.createElement( | |
parent, | |
props, | |
React.createElement( child, childProps ) | |
) |
NewerOlder