const compose = (...fns) =>
fns.reduceRight((prevFn, nextFn) =>
(...args) => nextFn(prevFn(...args)),
value => value
);
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 _ from 'lodash'; | |
| /** | |
| * Deep diff between two objects - i.e. an object with the new value of new & changed fields. | |
| * Removed fields will be set as undefined on the result. | |
| * Only plain objects will be deeply compared (@see _.isPlainObject) | |
| * | |
| * Inspired by: https://gist.github.com/Yimiprod/7ee176597fef230d1451#gistcomment-2565071 | |
| * This fork: https://gist.github.com/TeNNoX/5125ab5770ba287012316dd62231b764/ | |
| * |
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 { useReducer } from 'react' | |
| export function updateName(name: string) { | |
| return <const>{ | |
| type: 'UPDATE_NAME', | |
| name | |
| } | |
| } | |
| export function addPoints(points: number) { |
- http://stackoverflow.com/questions/804115 (
rebasevsmerge). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebasevsmerge) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse) - http://stackoverflow.com/questions/292357 (
pullvsfetch) - http://stackoverflow.com/questions/39651 (
stashvsbranch) - http://stackoverflow.com/questions/8358035 (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/5798930 (
git resetvsgit rm --cached)
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 copyToClipboard( text ){ | |
| var copyDiv = document.createElement('div'); | |
| copyDiv.contentEditable = true; | |
| document.body.appendChild(copyDiv); | |
| copyDiv.innerHTML = text; | |
| copyDiv.unselectable = "off"; | |
| copyDiv.focus(); | |
| document.execCommand('SelectAll'); | |
| document.execCommand("Copy", false, null); | |
| document.body.removeChild(copyDiv); |
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
| var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
| $(document).keydown(function(e) { | |
| kkeys.push( e.keyCode ); | |
| if ( kkeys.toString().indexOf( konami ) >= 0 ) { | |
| $(document).unbind('keydown',arguments.callee); |
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(r,e,a,d,y){function $(f){d?f():r.push(f)}e.ready=$;e.addEventListener(a,y=function(){d=!e.removeEventListener(a,y,d);while(y=r.shift())y()},d)}([],document,'DOMContentLoaded',!1); |
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
| Here is a list of scopes to use in Sublime Text snippets - | |
| ActionScript: source.actionscript.2 | |
| AppleScript: source.applescript | |
| ASP: source.asp | |
| Batch FIle: source.dosbatch | |
| C#: source.cs | |
| C++: source.c++ | |
| Clojure: source.clojure | |
| CoffeeScript: source.coffee |