Skip to content

Instantly share code, notes, and snippets.

View notwa's full-sized avatar
🚲
bikeshedding

Connor notwa

🚲
bikeshedding
View GitHub Profile
@notwa
notwa / 360-stick.ahk
Last active December 14, 2015 04:48
left stick to WASD, tested with 360 controller
#Persistent
#SingleInstance Force
Send {w up}
Send {a up}
Send {s up}
Send {d up}
Deadzone := 0.6
SetTimer Wax, 5
return
@notwa
notwa / spddiff.avs
Last active November 7, 2016 02:08
speedrun comparison (avisynth)
global fontsize = 26
function DiffClip(clip c, int diff)
{ BlankClip(c, diff).Subtitle(String(-diff), align=5, size=c.Height / 8) }
function PadWithDiff(clip c, int len)
{ c.FrameCount < len ? c + DiffClip(c, len - c.FrameCount) : c }
function DualMonoToStereo(clip left, clip right)
{ MergeChannels(ConvertToMono(left), ConvertToMono(right)) }
@notwa
notwa / main.lua
Last active December 14, 2015 19:09
graphing stuff with lua + LOVE
function lerp(x0, x1, t)
return x0*(1-t) + x1*t
end
function blendExp(x0, x1, t)
return x0^(1-t)*x1^t
end
local sw = 640
local sh = 480
@notwa
notwa / lsf.sh
Last active December 17, 2015 08:38
ultra-fancy ultra-pointless `ls -l` alternative
#!/bin/bash
# ultra-fancy ultra-pointless `ls -l` alternative
# to be sourced by bash or zsh
# similar project: https://github.com/trapd00r/ls--
# to maintain zsh compatibility:
# $() is surrounded in double quotes
# echo -E is used to avoid \033 expanding
# bare asterisks are escaped to prevent globbing
# arrays are used instead of relying on word expansion
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef BUFFER
#define BUFFER 4096
#endif
uint8_t msg[BUFFER];
/* CRC-32, eg. ethernet */
@notwa
notwa / render.zsh
Created June 27, 2013 18:54
render all fonts to png, zsh+pango+infinality
#!/bin/zsh
in=(**/*.(otf|ttf))
size=16
outdir='rendered-again'
lipsum='Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper a
@notwa
notwa / boorufind
Last active December 20, 2015 08:48
(dan)booru zsh stuff
#!/bin/zsh
q=$1
url='http://danbooru.donmai.us/posts.xml'
de=--data-urlencode
curl=(curl -sS -m 32 --connect-timeout 8 --retry 3 --retry-delay 1)
die() {
echo -E "$@" >&2
exit 1
@notwa
notwa / gist:9388998
Created March 6, 2014 12:57
purple is cool
We couldn’t find that file to show.
@notwa
notwa / PKGBUILD
Last active August 29, 2015 13:57
vivante drivers for xorg
_srcbase=xorg-drv-vivante
pkgname=${_srcbase}
pkgver=r5.75c3769
pkgrel=3
arch=(armv7h)
url="http://www.kernel.org/"
license=('MIT')
depends=('gpu-viv-bin-mx6q-x11')
provides=("$_srcbase")
conflicts=("$_srcbase")
Section "Device"
Identifier "i.MX Accelerated Framebuffer Device"
Driver "vivante"
Option "fbdev" "/dev/fb0"
Option "vivante_fbdev" "/dev/fb0"
Option "HWcursor" "false"
EndSection
Section "ServerFlags"
Option "BlankTime" "0"