Skip to content

Instantly share code, notes, and snippets.

@Krishna
Krishna / scribbles painting
Created March 3, 2011 16:14 — forked from lorenbrichter/scribbles painting
Bezier OpenGL code stuff via atebits
#include "Painting.h"
#include "Bezier.h"
#include "ProgressOp.h"
#include <math.h>
#include <sys/time.h>
#include <float.h>
#define MAX_ZOOM 12.0
#define MIN_ZOOM -40.0
@Krishna
Krishna / emailAddresses.m
Created October 14, 2011 16:26 — forked from 0xced/README.md
ABGetMe implementation for iOS
// Application must link with the MessageUI framework
NSArray* AccountEmailAddresses(void)
{
NSMutableArray *addresses = [NSMutableArray array];
@try
{
NSString *MailAccountProxy = [[NSArray arrayWithObjects:@"Mail", @"Account", @"Proxy", nil] componentsJoinedByString:@""];
NSString *MFMailAccountProxy = [@"MF" stringByAppendingString:MailAccountProxy];
Class MailAccountProxyClass = NSClassFromString(MFMailAccountProxy) ?: NSClassFromString(MailAccountProxy);
SEL reloadAccounts = NSSelectorFromString([[NSArray arrayWithObjects:@"reload", @"Accounts", nil] componentsJoinedByString:@""]);
@Krishna
Krishna / ebooks.md
Created December 2, 2011 16:23 — forked from roidrage/ebooks.md
Self-published and awesome
@Krishna
Krishna / face_detector.rb
Created December 8, 2011 15:42 — forked from pvinis/face_detector.rb
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
#import "LCYThing.h"
@interface LCYThing (Transmogrify)
- (void) turnIntoCat;
@end
@Krishna
Krishna / gist:4204033
Created December 4, 2012 13:46 — forked from futureperfect/gist:1097449
Alan Kay's talk at Creative Think seminar, July 20, 1982
Alan Kay's talk at Creative Think seminar, July 20, 1982
Outline of talk: Metaphors, Magnetic Fields, Snobbery and Slogans
The best way to predict the future is to invent it.
Humans like fantasy and sharing:
Fantasy fulfills a need for a simpler, more controllable world.
Sharing is important - we're all communication junkies. We have an incredible bandwidth
@Krishna
Krishna / gist:4247608
Created December 10, 2012 00:09 — forked from BenedictC/gist:4246759
A marco for creating enums with values which can be logged (inspired by http://rentzsch.tumblr.com/post/37512716957/enum-nsstring and long train journey).
#define EMKStringableEnum(ENUM_NAME, ENUM_VALUES...) \
\
typedef enum { \
ENUM_VALUES \
} ENUM_NAME; \
\
\
\
static NSString * ENUM_NAME##ToString(long enumValue) { \
//
// StickyHeaderLayout.h
// Wombat
//
// Created by Todd Laney on 1/9/13.
// Copyright (c) 2013 ToddLa. All rights reserved.
//
// Modified from http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using THANKS!
//

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
  Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView