This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import codecs, sys | |
try: | |
infile, outfile = sys.argv[1], sys.argv[2] | |
except IndexError: | |
sys.stderr.write('usage: %s input_file output_file\n' % sys.argv[0]) | |
sys.exit(1) | |
nfo = codecs.open(infile, encoding='utf-8').read() | |
codecs.open(outfile, 'w', encoding='cp437').write(nfo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.onepush { | |
margin-left: 8.65%; | |
} | |
.twopush { | |
margin-left: 17.3%; | |
} | |
.threepush { | |
margin-left: 25.95%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import optparse | |
import os | |
import plistlib | |
import sys | |
PLIST_START = '<?xml' | |
PLIST_END = '</plist>' | |
def udidlist(fn): | |
fn = os.path.expanduser(fn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bin=/usr/local/bin | |
PINBOARD_USERNAME= | |
PINBOARD_PASSWORD= | |
cd $HOME/Documents/Backup/Bookmarks && { | |
file=pinboard.xml | |
curl -s "https://$PINBOARD_USERNAME:$PINBOARD_PASSWORD@api.pinboard.in/v1/posts/all" > $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
a styled php version you can throw up on your apache | |
because i'm some kind of machinist | |
--> | |
<style> | |
/* oooh */ | |
html, body, ul, li { font-family: Verdana; font-size: 14px; line-height: 20px; } | |
body { width: 400px; margin: 20px auto; background: #333; } | |
ul { list-style: none; } | |
li { margin-bottom: 10px; color: #AAA; overflow: hidden; height: 20px; white-space: nowrap; text-overflow: ellipsis; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jekyll plugin to selectively allow blog posts to use PHP. | |
Copy php_posts.rb to your _plugins folder. Set 'php: yes' on a post, and | |
Jekyll will generate an 'index.php' file for it (rather than 'index.html'). | |
This has only been tested with the following permalink format: | |
/:year/:title/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>start.io/{Username}</title> | |
<style type="text/css"> | |
body { | |
background: #fff; | |
color: #000; | |
font: 300 1em/1.5 'Helvetica Neue', 'Helvetica', sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
NewerOlder