Skip to content

Instantly share code, notes, and snippets.

View coryalder's full-sized avatar

Cory Alder coryalder

View GitHub Profile
// extends http://johnehartzog.com/2009/10/easy-to-create-buttons-with-cocos2d/
// give you a button that toggles between two images
// uses cocos2d 0.9, so all the classes are called CCMenuItem instead of MenuItem.
// other than that it should work with older versions of cocos2d
+ (id)buttonWithImage:(NSString*)file
andImage:(NSString *)otherFile
atPosition:(CGPoint)position
target:(id)target
selector:(SEL)selector
@coryalder
coryalder / New Roman Times.dvtcolortheme
Created February 4, 2011 21:07
New Roman times (http://objectivesea.tumblr.com/post/2830368087/proportional-font-programming) updated for Xcode 4. Place in ~/Library/Developer/Xcode/UserData/FontAndColorThemes/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
@coryalder
coryalder / Appropirate.py
Created May 17, 2011 05:51
Creates a glitching effect called "datamoshing" using pygame and pymedia
#! /usr/bin/env python
# based on vplayer.py (http://pymedia.org/tut/src/vplayer.py.html) by dmitry borisov (http://pymedia.org)
# bloated and uglied for fair reasons by sven könig (http://www.popmodernism.org)
import sys, thread, time, traceback, Queue, os
import optparse
import pymedia
import pymedia.video.muxer as muxer
@coryalder
coryalder / blogpost.md
Created August 17, 2011 07:37
Extract html book files from the safari books online iPad app "Safari To Go" using php.

Save books out of Safari Books Online

From http://objectivesea.tumblr.com/post/9033067018/safaribooks

This is hard. I spent way too much time figuring this out, because I was annoyed that a book I bought (Addison-Wesley) was available online for free, except only for 45 days after which payment was required. So I made this hack... probably useful to no one else, but here it is.

Requirements:

  1. iPad.
  2. Safari To Go (the Safari Books Online iPad app).
@coryalder
coryalder / debugserver.js
Created September 6, 2011 18:26
A quick node.js HTTP debug server
// associated blog post here: http://objectivesea.tumblr.com/post/9883454476/node-js-as-an-http-debug-server
var http = require('http');
var echoStore = ''; // put initial value here, will be replaced with the contents of any put or post request.
var server = http.createServer(function (request, response) {
var data = '';
request.on('data', function (chunk) {
@coryalder
coryalder / cbcradioapps.txt
Created September 13, 2011 00:27
Apps that provide access to CBC Radio Streams
iOS Apps
http://itunes.apple.com/ca/app/tunein-radio-pro/id319295332?mt=8
http://itunes.apple.com/ca/app/tunein-radio/id418987775?mt=8
http://itunes.apple.com/ca/app/ootunes-radio-recording-alarm/id302782364?mt=8
http://itunes.apple.com/ca/app/ifree-radio/id401485652?mt=8
Android Apps
http://daappsblog.blogspot.com/2010/03/listen-tweet-apps-for-android.html
https://market.android.com/details?id=com.radio.rapp&feature=search_result
@coryalder
coryalder / sopa.url
Created January 18, 2012 05:41
Wikipedia SOPA bypass
javascript:$('#mw-page-base, #mw-head-base, #content, #mw-head, #mw-panel, #footer').css('display','inherit'); $('#mw-sopaOverlay').css('display','none');
@coryalder
coryalder / BBFlakes.py
Created August 10, 2012 20:46 — forked from jshell/BBFlakes.py
Flake8 Script for BBEdit 10
#!/usr/bin/env python
"""
A quick script to install into your `Application Support/BBEdit/Scripts` folder.
This runs flake8 (requires flake8 to be installed at `/usr/local/bin` -
try ``pip install flake8``) and reformats the results
so that they show up in BBEdit's search results / error / warnings window. Then
the errors can be stepped through one at a time.
I've bound this to control-shift-l. You must save your Python file first before
running the check.
@coryalder
coryalder / textmatesparkle.sh
Created August 14, 2012 04:51
Automatically update to the current version of TextMate
#!/bin/bash
cd ~/textmate
git pull origin
git submodule update
ninja TextMate
: ${NEWTEXTMATEPATH:="$HOME/build/TextMate/Applications/TextMate/TextMate.app"}
if [ -d $NEWTEXTMATEPATH ]; then
rm -rf /Applications/TextMate.app
mv $NEWTEXTMATEPATH /Applications/
fi
@coryalder
coryalder / fb_open_source_ios
Created August 23, 2012 20:10
Open source libraries used in the new Facebook app.
Appirater
AQGridView
AutoHyperlinks
Boost
Chromium
CocoaLumberjack
CoreTextHyperlinkView
EGODatabase
EGOTableViewPullRefresh
HPGrowingTextView