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
{ | |
"08:00": { | |
"shake": [ | |
"2 scoops of casein", | |
"2 scoops of whey" | |
], | |
"supplements": [ | |
"1 pill of Optimen", | |
"3 pills of Omega 3" | |
] |
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 API_TYPE_REGEX = /API_[^_]*$/ | |
const notApiAction = type => !API_TYPE_REGEX.test(type) | |
const host = "https://www.izettle.com/starwars" | |
const handleResponse = res => { | |
if (res.status <= 400 && res.status >= 200) { | |
return res.json() | |
} |
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 day = ([...holes]) => { | |
const currentHole = holes.indexOf(1); | |
holes[currentHole] = 0; | |
if (currentHole === 0) { | |
holes[1] = 1; | |
} else if (currentHole === 4) { | |
holes[3] = 1; | |
} else { |
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
# App manifest generated Wed Sep 12 2018 21:07:22 GMT+0200 (Central European Summer Time) | |
# Settings: Facebook,Release,HideConsole | |
platforms: | |
x86_64-osx: | |
context: | |
excludeLibs: ["engine"] | |
excludeSymbols: ["FacebookExt"] | |
libs: ["engine_release"] | |
linkFlags: [] |
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
class Trie: | |
class Node: | |
def __init__(self, char=None): | |
self.children = [] | |
self.char = char | |
self.is_leaf = False | |
def put(self, child_node): | |
self.children.append(child_node) | |
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 getDayOfYear(){ | |
var now = new Date(); | |
var start = new Date(now.getFullYear(), 0, 0); | |
var diff = now - start; | |
var oneDay = 1000 * 60 * 60 * 24; | |
return Math.floor(diff / oneDay); | |
} |