View get-all-features-for-single-vin.sql
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, |
View gist:115a0fec6766a7592d7a66d48e915d3c
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: |
View eos-api.js
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, |
View logo-type_color.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View QEvBwg.markdown
Responsive: Higher Order Component to pass width/height to Components as props
A Pen by Dave Atchley on CodePen.
View async-generator-runner.js
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); | |
}; | |
} |
View bash-snippets.bash
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 |
View romans.js
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' }, |
View tco.js
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