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
// Promise.resolve(ids).then(ids => { | |
// return ids.reduce((cur, next) => { | |
// return cur.then(() => { | |
// return doThingThatReturnsPromise(next); | |
// }); | |
// }, Promise.resolve()); | |
// }).then(() => { | |
// console.log('all done'); | |
// }).catch(err => { | |
// console.error(err); |
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
if (Ext4 === undefined) { window.Ext4 = Ext; } | |
Ext4.define('UserAlerts', (function () { | |
return { | |
extend: 'WidgetBase', | |
height:40, | |
data: {}, | |
cls: 'UserAlerts', | |
listeners: { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content="Cross-timezone stopwatch"> | |
<meta name="keywords" content="time, watch, stopwatch, clock, timer"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Stopwatch</title> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.3/css/bulma.min.css"> | |
<style type="text/css"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content="Make tacos in the browser!"> | |
<meta name="keywords" content="taco, tacos, truck, austin"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Shopping cart</title> | |
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.3/css/bulma.min.css"> | |
<style type="text/css"> |
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
def my_reduce(func, lst): | |
#base case | |
if (len(lst) == 1): | |
return lst[0] | |
#recurse | |
temp = func(lst[0], lst[1]) | |
return my_reduce(func, [temp] + lst[2:]) | |
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
'use strict'; | |
// keeping things private | |
let store = (() => { | |
let debug = true; | |
let state = { | |
isLoggedIn: false, | |
user: {} | |
}; |
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 getItems(opts) { | |
passMuster(opts, { | |
table: 'string', | |
hashkey: 'string', | |
items: 'array', | |
_optional: { | |
rangekey: 'string', | |
rangeval: 'string', | |
project: 'string' | |
} |
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
'use strict'; | |
let DASH_LOWERCASE_REGEX = /-([a-z])/g; | |
let UNDERSCORE_LOWERCASE_REGEX = /_([a-z])/g; | |
let UPPERCASE_REGEX = /([A-Z])/g; | |
// func argument to .replace receives: | |
// 1) the matched substring | |
// 2) nth parenthesized substr match (i.e. if the pattern has any `()` group matches, | |
// those will be passed as the next args) |
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 range(x, y) { | |
if (typeof y === 'undefined') { | |
y = x; | |
x = 0; | |
} | |
let out = []; | |
while (x < y) { | |
out.push(x++); | |
} | |
return out; |
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
#!/bin/bash | |
mode="" | |
filename="" | |
# http://stackoverflow.com/a/7069755 | |
while test $# -gt 0; do | |
case "$1" in | |
-h|--help) |