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
#define A(obj, objs...) [NSArray arrayWithObjects:obj, ## objs , nil] | |
#define D(val, key, vals...) [NSDictionary dictionaryWithObjectsAndKeys:val, key, ## vals , nil] | |
// from http://news.ycombinator.com/item?id=1789839 |
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 array | |
wordlen = 8 | |
charwidth = 32 | |
charheight = 64 | |
def fillbuf(pg, font, word, buffer): | |
pg.beginDraw() | |
pg.background(0) | |
pg.fill(255) |
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/python | |
# Get a quasi-random list of band names, album names and track names from your | |
# iTunes folder. Tastes great with Orothron <http://github.com/inky/orothron>. | |
import os | |
import re | |
itunes_tracknum = re.compile(r'^[0-9]+(-[0-9]+)?\ ') | |
def filter_name(name): |
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
// that is, navigate to the direct URL for an image hosted on the world wide web, then >>>INVOKE<<< | |
// i wanted the bookmarklet to redirect to the new direct image URL but that was out of scope! | |
javascript:void(window.location="http://api.imgur.com/2/upload.json?url="+encodeURIComponent(window.location.href)); |
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
$ python entity2unicode.py <<< '… … … &troll; ☃' | |
… … | |
… … | |
… … | |
n/a &troll; | |
☃ ☃ |
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 ruby | |
# -*- ruby -*- | |
# This is a fully-functional set of donkey patches that will break | |
# Ruby so badly that it makes all of the Ruby Koans pass right out of | |
# the box. ALl you need to do is patch edgecase.rb with this line: | |
# | |
# require File.expand_path(File.dirname(__FILE__) + '/donkey_patches') | |
# | |
# so it's the first line of the file. Then save this file as |
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
require "weary" | |
module Tumblr | |
class Client < Weary::Client | |
VERSION = "v2" | |
POST_OPTIONS = [ | |
:state, :tags, :tweet, :date, :markdown, :slug, | |
:title, :body, # Text posts | |
:caption, :link, :source, :data, #Photo posts |
OlderNewer