Skip to content

Instantly share code, notes, and snippets.

View jonsterling's full-sized avatar

Jon Sterling jonsterling

View GitHub Profile
var hljs=new function(){var p={};var a={};function n(c){return c.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function k(s,r){if(!s){return false}for(var c=0;c<s.length;c++){if(s[c]==r){return true}}return false}function e(s,r,c){var t="m"+(s.cI?"i":"")+(c?"g":"");return new RegExp(r,t)}function j(r){for(var c=0;c<r.childNodes.length;c++){node=r.childNodes[c];if(node.nodeName=="CODE"){return node}if(!(node.nodeType==3&&node.nodeValue.match(/\s+/))){return null}}}function h(u,t){var s="";for(var r=0;r<u.childNodes.length;r++){if(u.childNodes[r].nodeType==3){var c=u.childNodes[r].nodeValue;if(t){c=c.replace(/\n/g,"")}s+=c}else{if(u.childNodes[r].nodeName=="BR"){s+="\n"}else{s+=h(u.childNodes[r])}}}s=s.replace(/\r/g,"\n");return s}function b(t){var r=t.className.split(/\s+/);r=r.concat(t.parentNode.className.split(/\s+/));for(var c=0;c<r.length;c++){var s=r[c].replace(/^language-/,"");if(p[s]||s=="no-highlight"){return s}}}function d(c){var r=[];(function(t,u){for(var s=0;s<t.childNodes.len
Here are some crash logs; I hope this helps!
(1) níŋ-U.GUD-e pa mu-na-è
niŋ??=e pa=0 mu-na-e-0
??=LOCT CVNE=ABS CP-DAT3-manifest-ABS3I
'For him, he made manifest the ancient things.'
'For him, he made manifest the appropriate things.'
(2) ur-saŋ níŋ-U.GUD-e gù ba-a-dé
ursaŋ=0 niŋ??=e gu=0 ba-?-de-0
hero=VOC ??=LOCT voice=ABS CP-ERG2-pour-ABS3I
template <typename T>
T *autoreleasedInstance() {
return [[[[T class] alloc] init] autorelease];
}
int main (int argc, const char * argv[]) {
NSString *obj = autoreleasedInstance<NSString>();
NSLog(@"obj: %@", [obj class]);
// => obj: __NSCFConstantString
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
typedef NSString AMBlockToken;
@jonsterling
jonsterling / .gitignore
Created May 14, 2011 22:57
The Type Class Idiom in Haskell, Scala, C++, and Objective-C
*.class
*.swp
module Test where
import Data.Char
testValue :: IO (Maybe String)
testValue = Just `fmap` getLine
pureExample :: String -> String
pureExample (c:cs) = toUpper c : pureExample cs
pureExample [] = []
@jonsterling
jonsterling / gist:1117345
Created July 31, 2011 23:30
Feeds I like
@jonsterling
jonsterling / gist:1541947
Created December 30, 2011 23:09
Configuring UITableViews with C99 array initialization!
// Define your table view's sections
typedef enum {
kTitleSection = 0,
kGoalSection,
kNumberOfSections
} NESTemplateEditTableSections;
// Make configuration arrays indexed against table sections.
// It's safe to reorder the original enum!
static NSString * const kCellIdentifiers[kNumberOfSections] = {
@jonsterling
jonsterling / Output.h
Created February 15, 2012 15:53
Algebraic Data Types in C: Example Output
// This is the output of my ADT preprocessor
struct Expr {
enum {Plus,Times,Inc,Dec} tag;
union {
struct {
int l;
int r;
} Plus;
struct {