Skip to content

Instantly share code, notes, and snippets.

View maddievision's full-sized avatar
always sparkly

maddie lim ✨ maddievision

always sparkly
View GitHub Profile
@maddievision
maddievision / dotenv.sh
Created May 18, 2018 20:03
bash dotenv
#!/bin/sh
cd $(dirname $(realpath $0))
if [ -f .env ]; then
export $(cat ../.env | grep -v ^# | xargs)
fi
@maddievision
maddievision / slack-pink-sidebar-theme.md
Created April 16, 2018 19:51
Pink sidebar theme for Slack
#ff88bb,#ffeeff,#22ffcc,#6611ff,#ffeeff,#661122,#22ffcc,#EB4Dff

Screenshot

SMF and Real Time Events

channel messages

x = channel (first byte is called the status byte)

8x nn vv -note off
9x nn vv -note on
Ax nn pp -note pressure

Bx cc vv -control change

module NLMidi
require "unimidi"
#standard midi events
STATUS_NOTE_OFF = 0x80
STATUS_NOTE_ON = 0x90
STATUS_NOTE_PRESSURE = 0xA0
STATUS_CONTROL = 0xB0
STATUS_PROGRAM = 0xC0
STATUS_PRESSURE = 0xD0
@maddievision
maddievision / midiin.c
Created September 6, 2013 21:22
MIDI Input Logger (OS X)
//Andrew Lim 2013-09-07
//Compile with: -framework CoreMIDI -framework CoreFoundation -framework CoreAudio
#include <stdio.h>
#include <CoreMIDI/CoreMIDI.h>
const char * const NOTE_NAMES[] = {
"C","C#","D","D#","E","F","F#","G","G#","A","A#","B"
};
@maddievision
maddievision / gist:5655536
Last active December 17, 2015 18:49
unit conversion
# pip install Pint
from pint import UnitRegistry
ureg = UnitRegistry()
Q_ = ureg.Quantity
def convert(inp):
q,d = inp.split(' to ')
cvt = ""
try:
import struct
import json
import chunk
import wave
import hashlib
import binascii
import sys
import os
files = [x for x in os.listdir(".") if os.path.splitext(x)[1].lower() == '.spc']
!play >l16 df>f<f df>e<f df>d<f >c<da#d adgd ada#d >c<gfg >c<geg >cg<cg <a#>g<a>g <a#>gcg dgeg df>f<f df>e<f df>d<d>c<da#d adgd ada#d >c<cec fcgc >c<cgc >c<c>d<c >e<c>c<c >>c<<c>c<c
!p my.['cap_irc'] = ['ffffff','202020','4485fd','5ed089','ff925b','ff4a77','ff63ce','ffbd61','ffdd8b','ade678','6cccff','b1fff0','ffb1ff','404040','808080']
@maddievision
maddievision / gist:5499851
Created May 2, 2013 02:54
weechat nick color algo
int
irc_nick_hash_color (const char *nickname)
{
int color;
const char *ptr_nick;
if (!irc_config_nick_colors)
irc_config_set_nick_colors ();
if (irc_config_num_nick_colors == 0)