Skip to content

Instantly share code, notes, and snippets.

View coleww's full-sized avatar

Cole Willsea coleww

  • (=^.^=)
  • Berkeley, CA
View GitHub Profile
@coleww
coleww / compute-sizes.js
Created March 1, 2024 00:47
Compute responsive sizes
// 1. Paste the first script into the console
// 2. Slowly resize the browser window, covering full range
// 3. Paste the second script into the console
// This could probably be a browser extension that overlays the data on each image...
// SCRIPT ONE
// breakpoint values that we want to calculate `sizes` for
@coleww
coleww / weed.json
Created September 5, 2015 13:21
2,945 types of weed
{
"weeds": [
"+ Speed",
"1 Eyed Jamaican",
"1024",
"2 Pounder",
"2 Can Sam",
"2064",
"3fer",
"3 Kings",
@coleww
coleww / onek
Created August 31, 2014 17:11
1,000 lines of A Thousand Plateaus
and the sequence of nucleic units, with binary relations between units of the same type and biunivocal relationships between units of different types. Thus there are always two articulations, two segmentarities, two kinds of multiplicity, each of which brings into play both forms and substances. But the distribution of these two articulations is not constant, even within the same stratum.
"before" the State, and of the State "after" the primitive peoples—as if the two waves that seem to us to exclude or succeed each other unfolded simultaneously in an "archaeological," micropo-litical, micrological, molecular field.
(segmentometers), and conversions into lines of death (deleometers). Thus there is a whole process of selection of assemblages
A becoming is not a correspondence between relations. But neither is it a resemblance, an imitation, or, at the limit, an identification. The whole
a continuous variation for a discontinuous variable ... A variable can be continuous over a portion of its trajectory,
@coleww
coleww / downloadAll.js
Last active May 16, 2022 23:33
bandcamp download all purchases
// for use on https://bandcamp.com/download pages.
// once all the download links on the page are loaded,
// open the javascript console, paste the following code in, and hit enter.
// leave the page open until the downloads stop,
// it'll pause for 30 seconds after every click to ensure the last download has started already.
var secs = 30; // adjust as needed for slower connections.
var intervalTime = secs * 1000
var toDownload = [].slice.call(document.querySelectorAll('.downloads a.item-button'));
var interval;
@coleww
coleww / freesound-id-scraper.js
Last active May 14, 2021 22:23
overtone/freesound get ids for samples
// `npm install --save request cheerio`
var request = require("request")
var cheerio = require("cheerio")
function getSampleIDs(query, min, max){
var url = "https://www.freesound.org/search/?q="+query+"&f=duration%3A%5B"+(min || 0)+"+TO+"+(max || 1)+"%5D&s=duration+asc&advanced=1&a_tag=1&a_filename=1&a_description=1&g="
request(url, function (error, response, html) {
if (!error && response.statusCode == 200) {
var $ = cheerio.load(html);
GRAVITY TEST
# BITSY VERSION 6.4
! ROOM_FORMAT 1
PAL 0
0,82,204
128,159,255
255,255,255
@coleww
coleww / gist:55cea96ff08dd30af611
Created July 18, 2014 14:11
weighted shuffle in ruby.
things.sort_by do |thing|
-((thing.created_at.to_f / Time.now.to_f) * rand)
end
@coleww
coleww / ubus.rb
Created October 11, 2014 14:25
a bunch of links i scraped from ubu.com
ubus = [
{txt: "John Giorno -- Restless: An Interview by Daniel Nester (2002)",
href: "http://www.ubu.com/papers/giorno_nester_interview.html"},
{txt: "Introduction -- Barbara Cole & Lori Emerson",
href: "http://www.ubu.com/papers/kg_ol_intro.html"},
{txt: "Zero Kerning -- Craig Dworkin",
href: "http://www.ubu.com/papers/kg_ol_dworkin.html"},
@coleww
coleww / loopy.html
Created June 22, 2016 01:43
looper buddy
<script>
var the_path_to_your_sound_file = "surf.mp3"
var context = new AudioContext();
var playSound = context.createBufferSource();
var getSound = new XMLHttpRequest();
getSound.open("GET", the_path_to_your_sound_file, true);
getSound.responseType = "arraybuffer";
getSound.onload = function() {
context.decodeAudioData(getSound.response, function(buffer){
playSound.buffer = buffer;
@coleww
coleww / gist:8379123
Created January 12, 2014 00:58
4'33"
puts "the performance is beginning now"
sleep 255
puts "the performance has ended"