Skip to content

Instantly share code, notes, and snippets.

View gekitz's full-sized avatar
🌴
On vacation

Georg Kitz gekitz

🌴
On vacation
View GitHub Profile
@gekitz
gekitz / generate_tags.rb
Created September 22, 2012 19:39
This gist shows a possibility to generate tag sites out of your post's tags
module Jekyll
class TagPage < Page
def initialize(site, base, dir, tag)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
@gekitz
gekitz / perfect.txt
Created September 11, 2012 12:50
The perfect gist
this is the perfect gist
ladidas test
@gekitz
gekitz / UIImage-Addition.m
Created September 11, 2012 11:46
Sample Method Swizzle
+ (void)initialize
{
NSError *error = nil;
[[self class] jr_swizzleClassMethod:@selector(imageNamed:) withClassMethod:@selector(gk_imageNamed:) error:&error];
}
+ (UIImage *)gk_imageNamed:(NSString *)str
{
UIImage *image = [UIImage gk_imageNamed:str];
if (!image && [str rangeOfString:@".jpg"].location == NSNotFound) {
Making right turns on red signals after stopping (and ensuring the path is clear of pedestrians and oncoming traffic) is allowed in most states, unless there is a specific restriction posted at the intersection or the traffic lights show a red arrow in place of the standard red light. Some areas will allow you to make a left turn on red going from a one-way street onto another one-way street. (Note: There is no "Right on Red" in New York City.)
@gekitz
gekitz / gist:2624119
Created May 6, 2012 20:04
Section Header Button
- (id)initWithFrame:(CGRect)frame {
    if ((self = [super initWithFrame:frame])) {
                UIImage *image = [[SMImageCacher instance] imageWithName:@"sectionHeader"];
                self.textPadding = UIEdgeInsetsMake(0, 10, 0, 90);
                self.font = [UIFont boldSystemFontOfSize:17];
                self.textColor = [UIColor whiteColor];
                self.backgroundColor = [UIColor colorWithPatternImage:image];
                self.shadowOffset = CGSizeMake(0, 1);
                self.shadowColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
                self.userInteractionEnabled = YES;
@gekitz
gekitz / gist:1582190
Created January 9, 2012 09:34
Memory Warning Fake
-(void) performFakeMemoryWarning {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SEL memoryWarningSel = @selector(_performMemoryWarning);
if ([[UIApplication sharedApplication] respondsToSelector:memoryWarningSel]) {
[[UIApplication sharedApplication] performSelector:memoryWarningSel];
NSLog(@"Memory Warning!!");
}
[pool release];
}