Skip to content

Instantly share code, notes, and snippets.

@llimllib
llimllib / padcolors.py
Last active February 10, 2023 23:45
Setting pad colors on the Novation LaunchKey Mini MK3
# This file demonstrates how to use midi codes to control the color of the
# keypads on a Novation LaunchKey mini; There is no official documentation of
# it as far as I can tell
#
# the LaunchKey MK2 Programmer's guide is useful, though not accurate to
# details on the MK3 mini:
# https://customer.novationmusic.com/sites/customer/files/novation/downloads/10535/launchkey-mk2-programmers-reference-guide.pdf
import random
import time
var Bezier=function(t){function n(i){if(r[i])return r[i].exports;var e=r[i]={exports:{},id:i,loaded:!1};return t[i].call(e.exports,e,e.exports,n),e.loaded=!0,e.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){"use strict";t.exports=r(1)},function(t,n,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(){function n(t,n,r,i,e){"undefined"==typeof e&&(e=.5);var o=h.projectionratio(e,t),s=1-o,u={x:o*n.x+s*i.x,y:o*n.y+s*i.y},a=h.abcratio(e,t),f={x:r.x+(r.x-u.x)/a,y:r.y+(r.y-u.y)/a};return{A:f,B:r,C:u}}var e=Math.abs,o=Math.min,s=Math.max,u=Math.acos,a=Math.sqrt,f=Math.PI,c={x:0,y:0,z:0},h=r(2),x=r(3),y=function(t){var n=t&&t.forEach?t:[].slice.call(arguments),r=!1;if("object"===i(n[0])){r=n.length;var o=[];n.forEach(function(t){["x","y","z"].forEach(function(n){"undefined"!=typeof t[n]&&o.push(t[n])})}),n=o}var s=!1,u=n.length;if(r){if(r>4)
@llimllib
llimllib / install.sh
Last active November 9, 2022 19:44
install and setup a mac exactly as I like it, in as automated a way as possible
#!/usr/bin/env bash
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
# previous install notes at:
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802
fancy_echo() {
@llimllib
llimllib / hamming.md
Created December 28, 2020 17:56
One Man's View of Computer Science

Richard W. Hamming

January 1969

One Man's View of Computer Science

Abstract

A number of observations and comments are directed toward suggesting that more than the usual engineering flavor be given to computer science. The engineering

#include <stdio.h>
#include <stdarg.h>
// https://github.com/nothings/stb
#define STB_DS_IMPLEMENTATION
#include "stb_ds.h"
// compile with: gcc -Wall -I . dabeaz_stb.c -o a && ./a
typedef struct datum datum;
$ raco pkg install scribble
Resolving "scribble" via https://download.racket-lang.org/releases/8.5/catalog/
Downloading https://download.racket-lang.org/releases/8.5/pkgs/scribble.zip
The following uninstalled packages are listed as dependencies of scribble:
scribble-lib
scribble-doc
Would you like to install these dependencies? [Y/n/a/c/?]
00: Resolving "scribble-lib" via https://download.racket-lang.org/releases/8.5/catalog/
Resolving "scribble-doc" via https://download.racket-lang.org/releases/8.5/catalog/
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
$ echo '{"a":{"b":"quoted \" } {{{"}}{"c":{"d":2}}{"e":{"f":3}}' | go run firstobject.go
{"a":{"b":"quoted \" } {{{"}}
default 20:39:37.686798-0400 Finder bundle 0x4ff8 is launch-disabled and needs to be set trusted
default 20:39:37.688071-0400 lsd *** Registration warnings for <private>:
default 20:39:37.688087-0400 lsd Missing iTunes metadata
error 20:39:37.693434-0400 lsd LSStringLocalizer development region English not found in localizations available for bundle <private>
default 20:39:37.694953-0400 lsd Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///Applications/Firefox.app/Contents/, NSFilePath=/Applications/Firefox.app/Contents/PlugIns, NSUnderlyingError=0x1267223d0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
default 20:39:37.695065-0400 lsd - 45683955: Checking whether application is managed at file:///Applications/Firefox.app//org.mozilla.firefox
default 20:39:37.695185-0400 lsd (null):5:4:1:0:_LSServerRegisterItemInfo begin
default 20