Skip to content

Instantly share code, notes, and snippets.

View audionerd's full-sized avatar

Eric Skogen audionerd

View GitHub Profile
@audionerd
audionerd / supersaw-shooter.scd
Last active March 22, 2024 06:29
SuperSaw (Roland JP-8000 and JP-8080) in SuperCollider
// via https://web.archive.org/web/20191104212834/https://www.nada.kth.se/utbildning/grukth/exjobb/rapportlistor/2010/rapporter10/szabo_adam_10131.pdf
(
{ | freq = 523.3572, mix=0.75, detune = 0.75 |
var detuneCurve = { |x|
(10028.7312891634*x.pow(11)) -
(50818.8652045924*x.pow(10)) +
(111363.4808729368*x.pow(9)) -
(138150.6761080548*x.pow(8)) +
(106649.6679158292*x.pow(7)) -
@audionerd
audionerd / import_map.json
Last active March 10, 2023 07:24
using @xstate/react v2.0.1 in a deno fresh app
{
"react": "https://esm.sh/@preact/compat",
"use-isomorphic-layout-effect": "https://esm.sh/*use-isomorphic-layout-effect?alias=react:preact/compat&deps=react",
"use-sync-external-store/": "https://esm.sh/*use-sync-external-store/",
"use-subscription": "https://esm.sh/*use-subscription?alias=react:preact/compat&deps=react",
"xstate": "https://esm.sh/*xstate@4.37.0?alias=react:preact/compat&deps=react",
"@xstate/react": "https://esm.sh/*@xstate/react@2.0.1?alias=react:preact/compat&deps=react"
}
@audionerd
audionerd / m5stack-rca-module.ino
Last active January 6, 2023 02:48
Playing Audio from the M5Stack RCA Module 13.2
// M5Stack Core Basic + RCA Module 13.2 (PCM5102)
// based on https://github.com/m5stack/M5Stack/blob/b3e801f/examples/Unit/RCA/RCA.ino
#include <M5Unified.h>
void setup() {
auto cfg = M5.config();
cfg.external_spk = true;
cfg.internal_spk = false;
@audionerd
audionerd / xstate-react-hooks.js
Created October 31, 2018 20:01
using xstate with react hooks
import React, { useState, useEffect, useMemo } from 'react'
import { Machine } from 'xstate'
import { interpret } from 'xstate/lib/interpreter'
const toggleMachine = Machine({
id: 'toggle',
initial: 'inactive',
states: {
inactive: {
on: { TOGGLE: 'active' }
@audionerd
audionerd / react-native-widont.js
Created May 27, 2016 18:29
Widon’t for React Native
//
//
// Widon’t for React Native
// Simply uses Unicode \u00a0 instead of &nbsp;
//
// via http://webservices.blog.gustavus.edu/2007/03/20/shaun-inmans-widont-ported-to-javascript/
export const widont = (text) => text.replace(/([^\s])\s+([^\s]+)\s*$/, '$1\u00a0$2')
@audionerd
audionerd / Forwarding ports from a docker container with Vagrant 1.6.md
Last active June 25, 2019 20:45
Forwarding ports from a docker container with Vagrant 1.6

Forwarding ports from a docker container with Vagrant 1.6

Vagrant 1.6 has a really nice feature which allows you to run a docker environment from any machine that can run Vagrant (even a Mac)

Behind the scenes, Vagrant creates a host VM which runs the docker containers.

The "gotcha" is: Vagrant won't automatically forward ports all the way back from the container->vagrant host VM->your mac. You have to do that step manually, by configuring your own host VM for Vagrant to use for hosting docker containers with. That host VM is told what ports to open.

Here's how I set up a local Wordpress development testing container.

@audionerd
audionerd / cool-nand-bames.md
Last active June 8, 2019 19:22
Celebrity Spoonerism Band Names

A spoonerism is “an error in speech or deliberate play on words in which corresponding consonants, vowels, or morphemes are switched (see metathesis) between two words in a phrase”.

Please help me compile a list of actual artists (e.g.: released music, maybe even toured) whose names are permutations of the names of other artists or celebrities.

  • Berry Weight
  • Bupsin Jieber
  • Com Truise
  • Edit Murphy
  • Gnarls Barkley
  • Hoodie Allen
@audionerd
audionerd / atom-script-babel-upgrade.md
Created February 5, 2019 18:38
Using rgbkrk/atom-script and the latest version of Babel

Using the latest version of Babel with rgbkrk/atom-script

Update Babel CLI

cd ~/.atom/packages/script
npm uninstall --save-optional babel-cli
npm install --save-optional @babel/cli@latest
npm install --save-dev @babel/preset-env@latest
npm install --save-dev @babel/core@latest
Idle
Artwork
Draw
Draw Idle
Draw Drawing
Marquee
Marquee Idle
Marquee Drawing Freeform
Marquee Drawing Line
Marquee Moving Artwork
Workspace
text focus -> Text Entry Mode
toolbar marquee tool -> Marquee Selection Mode
Drawing Mode
pointerdown -> Drawing
pointerup -> Drawing Idle
option key & pointerdown -> Erasing
Drawing Idle*
Drawing