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
package main | |
import ( | |
"flag" | |
"log" | |
"io/ioutil" | |
"net/http" | |
"time" |
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
<script> | |
// 5 octaves + 9 semitones under A440Hz is Midi Key Zero | |
const MidiKeyZero = 440/(Math.pow(2, 5) * Math.pow(2, 9/12)) ; | |
const ctx = new AudioContext(); | |
const oscis = new Map(); | |
const volumeCtrl = ctx.createGain(); | |
volumeCtrl.gain.value = 0; | |
volumeCtrl.connect(ctx.destination); |
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
// Implements stale-while-revalidate | |
self.addEventListener('fetch', event => { | |
const cached = caches.match(event.request); | |
const fetched = fetch(event.request); | |
const fetchedCopy = fetched.then(resp => resp.clone()); | |
// Call respondWith() with whatever we get first. | |
// If the fetch fails (e.g disconnected), wait for the cache. | |
// If there’s nothing in cache, wait for the fetch. | |
// If neither yields a response, return a 404. |
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
<!doctype html> | |
<style> | |
div { | |
height: 40px; | |
background: red; | |
} | |
body { | |
height: 100vh; | |
} | |
section { |
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
#!/bin/bash | |
FUZZ="0.0% 0.5% 1.0% 1.5% 2.0% 2.5% 3.0%" | |
COLORS="128 256" | |
CONV_OPTS="-resize 450 -layers optimize-plus -layers optimize-transparency" | |
mkdir output | |
for f in $FUZZ; do | |
convert +repage -fuzz $f -delay 4 -loop 0 $@ $CONV_OPTS ./output/im-$f.gif | |
for c in $COLORS; do |
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
<!doctype html> | |
<style> | |
html, body { | |
margin: 0; | |
background-color: #CCC; | |
box-sizing: border-box; | |
} | |
.item { | |
margin: 20px; | |
padding: 20px; |
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
Hello World |
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
{⍵ (({⊃∨/1 ⍵∧3 4=+/,1 0 ¯1∘.⊖1 0 ¯1⌽¨⊂⍵}⍣10000)⍵)} 90{⍵ ⍵⍴(⍳⍵*2)∊⍺?⍵*2}15 |
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() { | |
// TODO: rootMargin are completely ignored for now | |
// Constructor | |
window.IntersectionObserver = function(callback, options) { | |
options = options || {}; | |
if(!(callback instanceof Function)) { | |
throw('callback needs to be a function'); | |
} |
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
diff --git a/gulpfile.js b/gulpfile.js | |
index e027df5..8b8bd35 100644 | |
--- a/gulpfile.js | |
+++ b/gulpfile.js | |
@@ -112,7 +112,10 @@ function build() { | |
entries: ENTRY_FILE, | |
debug: true | |
}) | |
- .transform(babelify.configure({presets: ["stage-0","es2015"]})) | |
+ .transform(babelify.configure({ |