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
WITH all_builds AS ( | |
/* | |
* Set this up as a Materialized View after each "sync" process | |
* which allows querying by VIN # or build_id | |
*/ | |
SELECT | |
'Base' as type, | |
s.header as header, | |
s.description as description, | |
null as value, |
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
/**************\ | |
* Algorithms * | |
\**************/ | |
// Given an array of objects summarizing the number of fish in an aquarium, | |
// find the percent of fish where the species is unknown (the `species` is | |
// `undefined`). Return the percentage as a whole number between `0` and `100`. | |
// Example input: |
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 fetch = require('isomorphic-fetch'); | |
function pad(number) { | |
if (number < 10) { | |
return '0' + number; | |
} | |
return number; | |
} | |
// eosd currently has issues with "real" ISO time format, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
A Pen by Dave Atchley on CodePen.
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
// Sources... | |
let arr = [1,2,3,4]; | |
// thunk returning function that takes a callback | |
// and applies the arg to it after ms milliseconds timeout | |
function delay(arg, ms=1000) { | |
return function(callback) { | |
setTimeout(_=>callback(arg), ms); | |
}; | |
} |
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 | |
# disable builtin echo so we can use '-en' | |
enable -n echo | |
SCRIPT=$(basename "$0") | |
SCRIPT_DIR=$(dirname "$0") | |
echo "$SCRIPT running from $SCRIPT_DIR" | |
# Determine if we're interactive or not |
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 int2roman(n) { | |
var map = [ | |
{ factor: 1000, letter: 'M' }, | |
{ factor: 900, letter: 'CM' }, | |
{ factor: 500, letter: 'D' }, | |
{ factor: 400, letter: 'CD' }, | |
{ factor: 100, letter: 'C' }, | |
{ factor: 90, letter: 'XC' }, | |
{ factor: 50, letter: 'L' }, | |
{ factor: 40, letter: 'XL' }, |
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(s, e, res) { | |
if (!res) { res = []; } | |
res.push(s); | |
if (s == e ) { | |
return res; | |
} | |
else { | |
if (s<e) { s++; } | |
else { s--; } | |
return range(s, e, res); |
NewerOlder