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
# script to create movie from multiple png files | |
dir=${1-"timelapse"} | |
cd $dir; | |
echo "Creating symlinks..."; | |
# start at 0 | |
count=0 |
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 | |
# Minimal script for timelapse capturing your screen in MacOSX. | |
# You must run the script, from an empty directory where the images will be stored. | |
# Usage: ./timelapse | |
# or | |
# Usage: ./timelapse <seconds> |
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; |
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
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
// 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
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
/* | |
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
//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
[10, 2, 1, 4, 5, 33].forEach(n => setTimeout(() => console.log(n), n)); |
OlderNewer