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
$.when( | |
createBaseCharts('.tile-area') | |
.then(createTicks), | |
fetchTalkContentData() | |
.then(parseTalkContentData) | |
) | |
.then((charts, data) => { | |
fadeUnnecessaryTicks(charts) | |
.then(addWordDensityBubbles) | |
.then(addCursor) |
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
[10, 2, 1, 4, 5, 33].forEach(n => setTimeout(() => console.log(n), n)); |
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
import glob | |
import bpy | |
# Fix Kenney's 3D objects (http://kenney.itch.io/kenney-donation) in Three.js | |
# Three.js' object loader barfs when object is not made of simple quads. | |
# This script uses Blender command-line to load each asset, converts to tris, | |
# then convert to quads (to remove some vertices), and re-saves (overwrites!) | |
# To run: |
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
//Getting length of the youtube vids... | |
$('#yt_player_container').on("onPlayerReady", (msg) => { | |
$.when().then(delay(1000)).then(() => { | |
_.toArray(window.talk_metadata) | |
.reduce((seq, talk) => seq.then(() => { | |
return new Promise((res, rej) => { | |
const cb = ({event}) => { | |
if (event == YT.PlayerState.PLAYING) { | |
stopVideo(); |
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
/* | |
A sweet.js macro for adding a JS identifier | |
binding (`val`) that is the same as a `const` declaration, | |
that is then frozen with `Object.freeze`. | |
*/ | |
'use strict'; | |
macro val { | |
rule { |
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
var canvas = document.createElement("canvas"); | |
var ctx = canvas.getContext("2d"); | |
canvas.width = 300; | |
canvas.height = 300; | |
document.body.appendChild(canvas); | |
ctx.fillStyle = "#000"; | |
ctx.fillRect(0, 0, canvas.width, canvas.height); |
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
// Is there a way to define immutable parameters in ES6? | |
const inc = x => { | |
x++; // Oh no, you modified x! | |
return x; | |
} | |
// Is it better to reassign to const (if it should be constant, of course)? | |
const inc = x => { |
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
on run {input, parameters} | |
tell application "iTerm" | |
create window with default profile | |
tell current window | |
tell current session | |
set firstInput to (first item of input) | |
set fullPath to (firstInput as text) | |
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/sh | |
FN="tweetPing$(date +"%T" | sed 's/://g').txt" | |
echo $FN | |
while true | |
do | |
TIME=$(date +"%T") | |
# Ping returns: |
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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform sampler2D from, to; | |
uniform float progress; | |
uniform vec2 resolution; | |
void main() { | |
vec2 p = gl_FragCoord.xy / resolution.xy; |