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
export enum Direction { | |
Up = 'Up', | |
Right = 'Right', | |
Down = 'Down', | |
Left = 'Left', | |
} | |
export interface XY { | |
x: number; | |
y: number; |
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
[alias] | |
up = pull --rebase --autostash | |
br = branch | |
st = status | |
ci = commit | |
ciam = commit --amend --no-edit | |
co = checkout | |
pf = push --force-with-lease | |
pb = "!git push -u origin \"$(git rev-parse --abbrev-ref HEAD)\"" | |
clean-local = "!git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d" |
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 snakifyKeys(fields) { | |
// because this function can receive map of ArrayNodes, we have to do this | |
let jsonFields = JSON.parse(JSON.stringify(fields)); | |
for (let key in jsonFields) { | |
if (jsonFields[key] instanceof Object) { | |
// we need to go deeper! | |
jsonFields[key] = snakifyKeys(jsonFields[key]); | |
} |
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
/* Calls callback function if value of given element stops changing | |
elem - element which's value we're watching | |
callback - anonymous method or callback fuction name | |
(delay) - delay before callback | |
*/ | |
wait_for_it = function(elem, callback, delay) { | |
var old_val; | |
if (delay == null) { | |
delay = 750; |
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
# Calls callback function if value of given element stops changing | |
# | |
# elem - element which's value we're watching | |
# callback - anonymous method or callback fuction name | |
# (delay) - delay before callback | |
wait_for_it = (elem, callback, delay = 750) -> | |
old_val = elem.val() | |
setTimeout ( -> | |
if elem.val() == old_val |