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
vector<string> split(string s, char delimiter) { | |
vector<string> r; | |
while (true) { | |
string::size_type l = s.find(delimiter); | |
if (l == string::npos) { | |
r.push_back(s); | |
break; | |
} | |
r.push_back(s.substr(0, l)); | |
s.erase(0, l + 1); |
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 | |
lctrl=30064771296 | |
rctrl=30064771300 | |
lcmd=30064771299 | |
rcmd=30064771303 | |
loption=30064771298 | |
roption=30064771302 | |
# -1 none |
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
#!/usr/bin/env python3 | |
from itertools import count, product, islice, takewhile | |
def syllables(): | |
cs = ['b','c','d','f','g','h','j','k','l','m','n','p','q','r','s','t','v','w','x','y','z'] | |
vs = ['a','e','i','o','u'] | |
for c in cs: | |
for v in vs: | |
yield c + v |
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
#!/usr/bin/env python3 | |
from os import listdir | |
import json | |
songfiles = list(listdir('songs')) | |
def songs_for(q): | |
return [{'url' : '/songs/' + file} for file in songfiles if file.startswith(q)] |
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
#!/usr/bin/env python3 | |
from os import listdir, mkdir, path | |
from subprocess import run | |
import json | |
songfiles = list(listdir('songs')) | |
if not path.exists('songs2'): | |
mkdir('songs2') |
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
const len = 100; // length of longest resonator | |
const count = 8; | |
const irr = (Math.sqrt(5) + 1) / 2; // a very irrational number | |
const s = 1 / irr; // length ratio between largest and smallest resonator | |
function main() { | |
return Array(count).fill(0) | |
.map((_, i) => resonator(Math.pow(s, i / (count - 1)))) | |
.reduce(combine); |
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
const len = 200; // length of longest resonator | |
const count = 8; | |
const irr = (Math.sqrt(5) + 1) / 2; // a very irrational number | |
const s = 1 / irr; // length ratio between largest and smallest resonator | |
function main() { | |
return Array(count).fill(0) | |
.map((_, i) => resonator(Math.pow(s, i / (count - 1)))) | |
.reduce(combine); |
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
let currentSlide = 0; | |
function display(slide) { | |
const sections = document.getElementsByTagName('section'); | |
currentSlide = Math.min(Math.max(slide, 0), sections.length - 1); | |
Array.from(sections).forEach((section, index) => { | |
section.style.display = index === currentSlide ? null : 'none'; | |
}) | |
} | |
document.addEventListener('keydown', event => { | |
if(event.key === 'ArrowRight' || event.key == ' ') display(currentSlide + 1); |
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> | |
let currentSlide = 0; | |
function display(slide) { | |
const sections = document.getElementsByTagName('section'); | |
currentSlide = Math.min(Math.max(slide, 0), sections.length - 1); | |
Array.from(sections).forEach((section, index) => { | |
section.style.display = index === currentSlide ? null : 'none'; | |
}) | |
} | |
document.addEventListener('keydown', event => { |
OlderNewer