Skip to content

Instantly share code, notes, and snippets.

View robrix's full-sized avatar
🌊
every dot and stroke I paint will be alive

Rob Rix robrix

🌊
every dot and stroke I paint will be alive
View GitHub Profile
@wouter-swierstra
wouter-swierstra / Wat.hs
Created September 23, 2016 03:05
Haskell Symposium Lightning Talk
GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help
Prelude> 1 + 2
3
Prelude> minimum(100,1)
1
Prelude> minimum(1,100)
100
Prelude> let splat = splitAt 5 [0..10]
Prelude> splat
([0,1,2,3,4],[5,6,7,8,9,10])
anonymous
anonymous / Set.swift
Created June 10, 2014 17:43
import Swift
struct SetGenerator<T : Hashable> : Generator {
var dictGenerator : DictionaryGenerator<T, Void>
init(_ d : Dictionary<T,Void>) {
dictGenerator = d.generate()
}
@kylesluder
kylesluder / ObjCSuper.m
Last active August 29, 2015 13:56
An Objective-C analogue to the Python super class.
// % clang -framework Foundation -o ObjCSuper ObjCSuper.m SuperTrampoline.s
// % ./ObjCSuper
//
// 2014-02-15 23:03:32.498 ObjCSuper[1296:507] Subclass impl
// 2012014-02-15 23:03:32.498 ObjCSuper[1296:507] Subclass impl4-02-15 23:03:32.500 ObjCSuper[1296:507] b respondsToSelector:@selector(retain)? YES
// 2014-02-15 23:03:32.500 ObjCSuper[1296:507] b respondsToSelector:@selector(subclassMethod)? YES
// 2014-02-15 23:03:32.501 ObjCSuper[1296:507] Superclass impl
// 2014-02-15 23:03:32.501 ObjCSuper[1296:507] b_super respondsToSelector:@selector(retain)? YES
// 2014-02-15 23:03:32.501 ObjCSuper[1296:507] b_super respondsToSelector:@selector(subclassMethod)? NO
@OdNairy
OdNairy / main.m
Last active December 21, 2015 00:28
// Source: https://devforums.apple.com/message/866487#866487
typedef int (*PYStdWriter)(void *, const char *, int);
static PYStdWriter _oldStdWrite;
int __pyStderrWrite(void *inFD, const char *buffer, int size)
{
if ( strncmp(buffer, "AssertMacros: queueEntry", 24) == 0 ) {
return 0;