Skip to content

Instantly share code, notes, and snippets.

@thenoviceoof
thenoviceoof / trivial.bash
Created January 23, 2013 15:53
Infinite github cheat
#!/bin/bash
# execute from cron for github cheese!
# assume starting from ~/
cd git/trivial
git rm *
r=`date | md5sum`
touch $r
git add .
git commit -m "$r"
# assumes you have master/origin configured
@thenoviceoof
thenoviceoof / pycc.py
Last active December 14, 2015 06:49
Oh god this is such a terrible idea
import timeit
# introducing a C primitive to the Python namespace for fun and profit
# if you're familiar with the way Python-C modules are usually built,
# you'll notice this is abstracting way a bunch of things,
# which may or may not be possible
# syntax: C <ret_type> <name>(...<params>...) with {<header>: <library>}
C str fn_name(int something) with {'stdio.h': 'stdlib', 'math.h': 'm'}:
// blah blah blah
@thenoviceoof
thenoviceoof / imperial_march.py
Last active September 28, 2020 12:19
Play the Imperial March with an IRobot Create, cloak and stormtroopers not required
import serial
import time
# this is the port you're connecting to the irobot with
# on windows, this is something like COM2
N = 2
def ints2str(lst):
'''
Taking a list of notes/lengths, convert it to a string
@thenoviceoof
thenoviceoof / firefly.ly
Created May 1, 2013 04:14
Because sometimes your other musically inclined roommates notice you can provide ambient strings
\version "2.14.1"
\header {
title = "Firefly Theme"
}
<<
\new ChordNames {
\chordmode {
s2
@thenoviceoof
thenoviceoof / phylactery.go
Created June 25, 2013 10:51
This is a small exercise, for making a program that will keep un-cooperative processes running when the processes are just lazy
/*
* phylactery.go
*******************************************************************************
* This is a small exercise, for making a program that will keep
* un-cooperative processes running when the processes are just lazy
*
* Do what you want with this code
*/
package main
@thenoviceoof
thenoviceoof / kbm.py
Last active January 4, 2016 14:59
Keyboard Mouse
# - A first approximation of using the keyboard as a trackpad
# - It uses curses/Xlib for input and mouse interaction, so if you don't
# have those you're going to have a bad time
# - This is only a proof of concept, sniffing X for keystrokes and
# finding out how to seamlessly pop in and out of
# keyboard-as-trackpad-mode is left as an exercise to the reader
# - It turns out this isn't a very good control scheme, given the
# limited vertical resolution (4-6 rows vs. ~12 columns), and that
# it additionally suffers from all the problems inherent in
# acceleration based control schemes