Skip to content

Instantly share code, notes, and snippets.

@charlieroberts
charlieroberts / marching_hydra_local.js
Created September 11, 2019 17:58
marching.js with hydra generated textures (local)
// first, download the hydra-synth repo: https://github.com/ojack/hydra-synth
// second, build it with browserify: browserify index.js -o hydra.js --standalone Hydra
// third, place the resulting hydra.js file in the smae directory as marching.js
script = document.createElement('script')
script.src = 'http://localhost:12000/hydra.js'
document.querySelector('head').appendChild( script )
canvas = document.createElement('canvas')
hydra = new Hydra({ canvas })
//
// WaveformView.swift
// WaveformSwiftUI
//
// Created by Adam Bell on 9/4/19.
// Copyright © 2019 Adam Bell. All rights reserved.
//
import SwiftUI
@mayneyao
mayneyao / notion2blog.js
Last active February 29, 2024 18:01
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@padeoe
padeoe / enhanced-nvidia-smi.md
Last active May 17, 2024 03:41
Show Username & full process command with nvidia-smi

This script enhances the functionality of nvidia-smi and provides the following information:

  • Username
  • full process Command
  • GPU ID
  • PID

This is useful on multi-user servers and can be used to quickly identify which user is using the GPU and running what kind of program.

@khoparzi
khoparzi / Sante-Algorave-26May-2019.tidal
Last active May 28, 2019 20:31
Code for my techno/footwork crossover set for Bengaluru's first Algorave
let chup = mute
o = octave
ruppit p = spread fast [1, 2, 3, 4] $ p
weird p = randDelay p = ((# delay (range 0.5 0.7 $ shift' 5001 $ rand)) . (# delaytime (shift' 5002 $ choose delays)) . (# delayfeedback (range 0.5 0.9 $ shift' 5003 $ rand))) $ p
microd p = often ((# delay 0.3) . (# delaytime (choose[(1/16), (1/32)])) . (# delayfeedback 0.8)) $ p
setcps(140/120)
-- Angles break from the famous pack of breaks
p "d"
@morcefaster
morcefaster / pros_are_nice.md
Last active January 22, 2024 14:59
Did anyone say drama?

Preface

Hello everyone. With Ceb drama getting so much traction, I decided to do what any rational person would do in this situation - download all public matches of all professional dota 2 players and then scan the all-chat for any racism or naughty naughty words, so the j͇͕͙ͣu͒͆s̼̠͍̖̮̳ͮ̃t̫̙̯͎ͬ̇̊̄iͨć̼͓ͬͨ͑ͣe͉̜̫̱̠̘̋̒ͅ can be upheld once and for all.

There are several nuances that stood in my way.

  1. Many professionals' pubs are kept private.
  2. Most of the trashtalk happens in ally chat, which isn't saved.
  3. Some of the trashtalk happens over mic... which again, isn't saved.
  4. Some of the trashtalk happens on smurf accounts, which I did not include here.

I’m currently trying to fully understand category theory as it applies to programming. I’m not scared of math, however, I’m also not a mathematician, so I’m looking for an introduction that helps me build intuitive understanding first, and then goes all the way into the formalisms.

Here are the resources I am currently reading that I found the most helpful so far:

Resources

Why Category Theory Matters • rs.io

http://rs.io/why-category-theory-matters/

Quick intro on why it's useful and lots of links to resources of applications of category theory.

@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

@JoshCheek
JoshCheek / hydra_custom_glsl.js
Last active May 14, 2019 18:24
hydra sketch with custom glsl (against hydra-synth dev branch)
synth.setFunction('josh', { type: 'src', inputs: [], glsl: `
float josh_circle(vec2 st, float cr, float cx, float cy) {
float dx = cx-st.x, dy = cy-st.y;
float z = cr*cr - dx*dx - dy*dy;
return (z < 0.) ? 0. : sqrt(z)/cr;
}
vec4 josh(vec2 st){
float z = josh_circle(st, .35, .5, .5);
z = z-josh_circle(st, .25, .5, .5)+josh_circle(st, 0.2, 0.5, 0.5)*0.75;
for(int i = 0; i < 10; i+=1) {
use std::collections::HashMap;
use std::fmt;
use std::io;
use std::num::ParseFloatError;
use std::rc::Rc;
/*
Types
*/