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
/* Seasonal palette*/ | |
body { | |
background: linear-gradient(to right, | |
hsl(217, 78%, 58%) 0, | |
hsl(59, 84%, 78%) 22%, /* spring equinox */ | |
hsl(40, 91%, 61%) 49%, /* summer solstice */ | |
hsl(18, 66%, 45%) 73%, /* autumn equinox */ | |
hsl(217, 78%, 58%) 99%); /* winter solstice */ | |
display:flex; height:100vw; | |
margin:0; |
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
// eg (buy_load|free_bee|no_signal) | |
topicWords = '('+ ['buy load', 'free bee', 'no signal'].join('|') +')'; | |
// eg (but|however|already) | |
complexWords = '('+ ['but', 'however', 'already'].join('|') +')'; | |
maxWordsBetween = 2; | |
// eg 'in there ' | |
maybeWordsBetween = '('+ `(\\W+\\w+){0,${maxWordsBetween}}` + ')'; |
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
/** in an era of public availability of source code, is explicit credit still necessary? */ | |
//codegolf.stackexchange.com/a/79490/69502 | |
continuous_fraction = f = (n,d) => n%d ? [r=(n/d)|0,...f(d,n-r*d)] : [n/d] | |
fill = (ch,n) => Array(n).fill(ch).join('') | |
bars = n => console.debug(fill('|', Math.abs(n)), n, fill(' ', Math.pow(Math.random(),-2)|0)) | |
interval = |
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
//stackoverflow.com/a/18123985/811330 | |
function removeDiacritics (str) { | |
return [ | |
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g}, | |
{'base':'AA','letters':/[\uA732]/g}, | |
{'base':'AE','letters':/[\u00C6\u01FC\u01E2]/g}, | |
{'base':'AO','letters':/[\uA734]/g}, | |
{'base':'AU','letters':/[\uA736]/g}, | |
{'base':'AV','letters':/[\uA738\uA73A]/g}, | |
{'base':'AY','letters':/[\uA73C]/g}, |
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
//codegolf.stackexchange.com/a/79490/69502 | |
continuous_fraction = f = (n,d) => n%d ? [r=(n/d)|0,...f(d,n-r*d)] : [n/d] | |
bars = n => console.debug(n, Array(n).fill('|').join('')) | |
interval = | |
setInterval(() => { | |
requestAnimationFrame(() => { | |
now = new Date | |
a = ~now |
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 __SMOKE_TEST__Catalog(){ console.log( | |
Catalog([{a:1, b:2}, {b:4, c:7, d:0}, {a:0, b:2}]) | |
)} | |
/* | |
ββββββββ¬βββββ¬ ββββββ | |
β βββ€ β βββ€β β ββ β¬ | |
ββββ΄ β΄ β΄ β΄ β΄β΄ββββββββ 18w40*/ | |
function Catalog(items){ | |
return ([].concat(arguments)).reduce(catalog, {}); |
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
var FONT = { | |
FAMILY: 'Inconsolata', | |
SIZE: 10 | |
}; | |
function onOpen() { | |
var menuTitle = 'Autoformat', | |
caption = [FONT.FAMILY, FONT.SIZE].join(' '), | |
functionName = 'autoformat' | |
SpreadsheetApp.getUi().createMenu(menuTitle).addItem(caption, functionName).addToUi() } |
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
/* | |
Calculates the Confusion Matrix for a range: [id, name, P, N, TP, TN, FP, FN] | |
@customfunction | |
*/ | |
function matrix(sheet) { | |
var values = SpreadsheetApp.getActiveSpreadsheet().getRange(sheet).getValues(), | |
// headers = values.slice(0,1), | |
headers = 'id,name,P,N,TP,TN,FP,FN'.split(','), | |
data = values.slice(1), | |
results = data |
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
#!/usr/bin/env bash | |
######################### | |
echo "Name this new tool like a Class, eloquent command or clear imperative verb" | |
read | |
mkdir $REPLY | |
cd $REPLY | |
echo "Created directory $REPLY" | |
######################### |
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
const USER = process.env.USER | |
, NAMESPACE = `@${USER}` | |
, NAME = encodeURIComponent(require('path') | |
.basename(process.cwd()) | |
.trim() | |
.toLowerCase() | |
.replace(/^_|\./, '') | |
//npmjs.com/package/validate-npm-package-name | |
// .replace(/[^~)('!*]/g, '') | |
.replace(/node|js/, '') |