Skip to content

Instantly share code, notes, and snippets.

JCRev r => dac;
0.05 => r.mix;
// https://lists.cs.princeton.edu/pipermail/chuck-users/2009-April/004150.html
// $ chuck scales.ck:left.wav:right.wav
if (me.args() > 1) {
dac.chan(0) => Gain g0 => WvOut w0 => blackhole;
dac.chan(1) => Gain g1 => WvOut w1 => blackhole;
0.8 => g0.gain;
0.8 => g1.gain;
#!/usr/bin/env python
HUMAN = 'beep boop'
ROBOT = '011000100110010101100101011100000010000001100010011011110110111101110000'
def splitbin(s):
for i in range(0, len(s), 8):
yield s[i : i + 8]
assert ROBOT == ''.join(bin(ord(c))[2:].zfill(8) for c in HUMAN)
@inky
inky / roman.c
Last active December 18, 2015 05:49
Roman numerals
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
typedef struct RomanChars_type {
char *chars;
unsigned int length;
size_t size;
} RomanChars;
@inky
inky / gist:4650026
Last active December 11, 2015 19:38
Scrabble as Gaeilge
L
L E
LEITHRIS
I H T
T Ó H
LEITHRIS R
R N I
I S
S
import urllib
from collections import defaultdict
FAVICON_URL = "http://daringfireball.net/graphics/favicon.ico?v=005"
print('Reading %s' % FAVICON_URL)
icon_bytes = urllib.urlopen(FAVICON_URL).read()
freq = defaultdict(int)
for byte in icon_bytes:
if lol:
return
no_lol()
if lol:
return
else:
no_lol()
@inky
inky / ok.c
Created November 11, 2012 01:53
#include <stdio.h>
#define GO puts
#define THE (
#define FUCK "GO THE FUCK TO SLEEP"
#define TO );
#define SLEEP return 0
int main()
{
GO THE FUCK TO SLEEP;
}
@inky
inky / sindome.sh
Created November 5, 2012 21:15
Sindome.org
#!/bin/sh
stty erase ^?
telnet moo.sindome.org 5555
@inky
inky / gist:3861265
Created October 9, 2012 20:38
Getting Psychic Seahorse up and running again with iOS 6 as the base SDK.
"Xcode cannot run using the selected device"?
→ Don't use the "iOS Device" scheme — look for the name of the device in the schemes list.
Linker error with Parsekit (or another sub-project)
→ Change the architecture to just "armv7", rather than "armv7, armv7s".
Parsekit crashing with "Symbol not found: _objc_setProperty_nonatomic"
→ Specify an iOS Deployment Target for Parsekit (i.e. don't leave it as "Default").
http://stackoverflow.com/questions/7874341/no-provisioned-ios-devices-are-available-with-a-compatible-ios-version/8252228#8252228
@inky
inky / udidlist.py
Created October 6, 2012 14:27
List the UDIDs in a provisioning profile. (For iOS/OS X developers.)
import optparse
import os
import plistlib
import sys
PLIST_START = '<?xml'
PLIST_END = '</plist>'
def udidlist(fn):
fn = os.path.expanduser(fn)