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
git lfs track "*.3ds" "*.3g2" "*.3gp" "*.7z" "*.a" "*.aac" "*.adp" "*.ai" "*.aif" "*.aiff" "*.alz" "*.ape" "*.apk" "*.ar" "*.arj" "*.asf" "*.au" "*.avi" "*.bak" "*.baml" "*.bh" "*.bin" "*.bk" "*.bmp" "*.BMP" "*.btif" "*.bz2" "*.bzip2" "*.cab" "*.caf" "*.cgm" "*.class" "*.cmx" "*.cpio" "*.cr2" "*.csv" "*.cur" "*.dat" "*.dcm" "*.deb" "*.dex" "*.djvu" "*.dll" "*.dmg" "*.dng" "*.doc" "*.docm" "*.docx" "*.dot" "*.dotm" "*.dra" "*.DS_Store" "*.dsk" "*.dts" "*.dtshd" "*.dvb" "*.dwg" "*.dxf" "*.ecelp4800" "*.ecelp7470" "*.ecelp9600" "*.egg" "*.eol" "*.eot" "*.epub" "*.exe" "*.f4v" "*.fbs" "*.fh" "*.fla" "*.flac" "*.fli" "*.flv" "*.fpx" "*.fst" "*.fvt" "*.g3" "*.gif" "*.GIF" "*.graffle" "*.gz" "*.gzip" "*.h261" "*.h263" "*.h264" "*.icns" "*.ico" "*.ief" "*.img" "*.ipa" "*.iso" "*.jar" "*.jpeg" "*.JPEG" "*.jpg" "*.JPG" "*.jpgv" "*.jpm" "*.jxr" "*.key" "*.ktx" "*.lha" "*.lib" "*.lvp" "*.lz" "*.lzh" "*.lzma" "*.lzo" "*.m3u" "*.m4a" "*.m4v" "*.mar" "*.mdi" "*.mht" "*.mid" "*.midi" "*.mj2" "*.mka" "*.mkv" "*.mmr" "*.mng" " |
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 daysOffset = 1; // next day delivery | |
const deadlineTime = 17 * 3600; // 17:00 in seconds | |
const unavailableDays = [0, 1]; // sunday = 0, monday = 1 | |
const unavailableDates = [ | |
/* 2019 */ | |
{ dateString: '2019-01-01', name: 'Nieuwjaarsdag' }, | |
{ dateString: '2019-04-01', name: '1e paasdag' }, | |
{ dateString: '2019-04-22', name: '2e paasdag' }, | |
{ dateString: '2019-04-27', name: 'Koningsdag' }, | |
{ dateString: '2019-05-30', name: 'Hemelvaartsdag' }, |
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
// modified https://github.com/getify/deePool | |
const EMPTY_SLOT = Object.freeze(Object.create(null)); | |
export default class ObjectPool { | |
constructor(objectFactory = () => {}, initialSize) { | |
this.objectFactory = objectFactory; | |
this.objPool = []; | |
this.nextFreeSlot = null; | |
if (!!initialSize) this.grow(initialSize); |
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
// get frequency from piano key number t | |
export function keyToFrequency(n, base = 440, keys = 12) { | |
return base * Math.pow(2, n / keys); | |
} | |
// get inverse frequency from piano key number t | |
export function keyToInverseFrequency(n, base = 440, keys = 12) { | |
return base * -Math.pow(2, -n / keys); | |
} |
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
export default class Vector2 { | |
constructor(x, y) { | |
this.x = x || 0; | |
this.y = y || 0; | |
} | |
// ---- public instance methods ---- | |
get name() { | |
const v = this.clone().normalize(); |
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
// Get the absolute url in various ways: | |
const url1 = '/' + this.route.pathFromRoot.map(r => r.snapshot.url).filter(f => !!f[0]).map(([f]) => f.path).join('/'); | |
const url2 = this.location.prepareExternalUrl(this.location.path()); |
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
<svg preserveAspectRatio="xMidYMid meet"> <!-- fits the parent, centered --> | |
<svg preserveAspectRatio="xMidYMid slice"> <!-- fills the parent, centered --> |
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
{% set colClass = 'col-' ~ (12 / max(2, min(blogPosts.length, 4))) %} | |
<div class="row"> | |
{% for article in blogPosts %} | |
<article class="{{ colClass }}"> | |
... | |
</article> | |
{% endfor %} | |
</div> |
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
// create an array with indices 0..(amount-1) | |
export function fill(amount) { | |
return Array.from(Array(amount).keys()); | |
} |
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 divideEvenly(arrays, numOutputs) { | |
const arraysLength = arrays.length; | |
const totalLength = arrays.reduce((amount, pool) => amount + pool.length, 0); | |
const result = []; | |
let pool, item, column; | |
for (let i = 0; i < totalLength; i++) { | |
pool = arrays[i % arraysLength]; | |
item = pool[Math.floor(i / arraysLength)]; | |
column = Math.floor(i / (totalLength / numOutputs)); |