Skip to content

Instantly share code, notes, and snippets.

View notwa's full-sized avatar
🚲
bikeshedding

Connor notwa

🚲
bikeshedding
View GitHub Profile
import numpy as np
import matplotlib.pyplot as plt
import scipy.signal as sig
# optionally, use an alternate style for plotting.
# this reconfigures colors, fonts, padding, etc.
# i personally prefer the look of ggplot, but the contrast is generally worse.
plt.style.use('ggplot')
# create log-spaced points from 20 to 20480 Hz.
from retry import retry
import requests, requests.exceptions
class StatusCodeError(Exception):
def __init__(self, code, url):
self.code = code
self.url = url
def __str__(self):
return 'request for {} returned status code {}'.format(self.url, self.code)
@notwa
notwa / Makefile
Last active July 5, 2017 02:37
r4300i disassembler by spinout182
#CFLAGS = -ggdb -Wall
CFLAGS = -Ofast -Wall
install: all
cp zadis /usr/bin/zadis
all:
$(CC) $(CFLAGS) -o zadis adis.c
clean:
@notwa
notwa / corepatchlua.lua
Created May 26, 2015 01:56
explicit globals
local mt = getmetatable(_G)
if mt == nil then
mt = {}
setmetatable(_G, mt)
end
mt.__declared = {}
function mt.__newindex(t, n, v)
if not mt.__declared[n] then
local info = debug.getinfo(2, "S")
if info and info.what ~= "main" and info.what ~= "C" then
@notwa
notwa / commands
Last active August 29, 2015 14:19
#!/usr/bin/env bash
shopt -s expand_aliases
input="phdump2.txt"
# matches ascii, fullwidth punctuation,
# and various japanese character blocks
regex='[\t\x{20}-\x{7E}\x{4E00}-\x{9FAF}\x{3000}-\x{30FF}\x{FF00}-\x{FFEF}]+'
# adds UTF-8 BOM
@notwa
notwa / enc.bat
Last active August 29, 2015 14:07
personal video/audio encode script
@ECHO OFF
set input=%1
set output="%~p1%~n1.fdk.mp4"
REM any of these can be commented out
set trim=start=0:duration=41
set scale=640:480
set aspect=4:3
set volume=24dB