Skip to content

Instantly share code, notes, and snippets.

View dlongmuir's full-sized avatar

Derek Longmuir dlongmuir

View GitHub Profile
@dlongmuir
dlongmuir / objc_memory.m
Created May 15, 2014 22:49
Testing different ways of defining Objective-C variables
@interface VariableNoBrackets : NSObject
@end
@implementation VariableNoBrackets
NSString *aString;
- (instancetype)initWithString: (NSString *)newString {
self = [super init];
if (self) {
aString = newString;
}
@dlongmuir
dlongmuir / diamond.clj
Last active August 29, 2015 14:13
Diamond Kata in (newb) Clojure
(def alphabet (map #(str (char %)) (range (int \A) (inc (int \Z)))))
(defn outside-spaces
[letter letters]
(loop [[current-letter & rest] letters
position 0]
(if (= current-letter letter)
position
(recur rest (inc position)))))