Skip to content

Instantly share code, notes, and snippets.

View nst's full-sized avatar

Nicolas Seriot nst

View GitHub Profile
@mbinna
mbinna / UIViewController+MBSensitiveInformationInScreenshotPrevention.h
Created June 12, 2011 13:00
Prevent sensitive information from appearing in the screenshot that is automatically taken when the application transitions from the foreground to the background and vice-versa.
//
// UIViewController+MBSensitiveInformationInScreenshotPrevention.h
//
// Created by Manuel Binna on 05.05.11.
// Copyright 2011 Manuel Binna. All rights reserved.
//
@interface UIViewController (MBSensitiveInformationInScreenshotPrevention)
@mikeash
mikeash / gist:1132620
Created August 8, 2011 20:17
Namespaced constants in C
#import <Foundation/Foundation.h>
// .h file
struct MyConstantsStruct
{
NSString *foo;
NSString *bar;
@timblair
timblair / markdown.css
Created August 25, 2011 15:57
Simple Markdown CSS
/* Based on http://kevinburke.bitbucket.org/markdowncss/ */
body{
margin: 0 auto;
font-family: Georgia, Palatino, serif;
color: #444444;
line-height: 1;
max-width: 960px;
padding: 30px;
}
@mediabounds
mediabounds / floatsign.sh
Last active March 31, 2024 18:43
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@0xced
0xced / NSData+Base64.h
Created February 24, 2012 15:03
NSData Base64 category
//
// Created by Cédric Luthi on 2012-02-24.
// Copyright (c) 2012 Cédric Luthi. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSData (Base64)
+ (id) dataWithBase64Encoding_xcd:(NSString *)base64String;
@0xced
0xced / NSRunningApplication+DockIcon.h
Created March 15, 2012 16:00
NSRunningApplication category to dynamically show and hide any running application icon in the Dock
//
// Created by Cédric Luthi on 2011-05-03
// Copyright 2011-2012 Cédric Luthi. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface NSRunningApplication (DockIcon)
- (BOOL) setDockIconHidden_xcd:(BOOL)dockIconHidden;
@cslarsen
cslarsen / objc-gcc.m
Created March 20, 2012 19:23
How to compile Objective-C on the command line on Mac OS X
/*
* To compile objective-c on the command line:
*
* gcc -framework Foundation objc-gcc.m
*
* You may have to link with -lobjc or other libs,
* as required.
*/
#import <Foundation/Foundation.h>
@iamleeg
iamleeg / pileOfPoo.m
Created March 22, 2012 01:51
The pile of poo Objective-C method
#import <Foundation/Foundation.h>
@interface A: NSObject
@end
@implementation A
void pileOfPoo(id self, SEL _cmd) {
NSLog(@"💩");
}
@0xced
0xced / Makefile
Created March 23, 2012 15:02
Experiment ->isa vs object_getClass()
OPTIONS = metaclass.m -o metaclass -std=c99 -framework Foundation -arch x86_64 -Os
isa:
clang -DUSE_ISA=1 $(OPTIONS)
./metaclass
object_getClass:
clang -DUSE_ISA=0 $(OPTIONS)
./metaclass
@Machx
Machx / results.txt
Created March 30, 2012 16:43
Test isEqual & isEqualToString
tail end of the results
2012-03-30 11:36:39.865 Untitled[78506:707] IsEqual: 1438 | isEqualToString 589
2012-03-30 11:36:39.875 Untitled[78506:707] IsEqual: 1377 | isEqualToString 590
2012-03-30 11:36:39.876 Untitled[78506:707] IsEqual: 956 | isEqualToString 560
2012-03-30 11:36:39.877 Untitled[78506:707] IsEqual: 860 | isEqualToString 451
2012-03-30 11:36:39.877 Untitled[78506:707] IsEqual: 824 | isEqualToString 433
2012-03-30 11:36:39.878 Untitled[78506:707] IsEqual Average 1212 - IsEqualToString Average 619