Skip to content

Instantly share code, notes, and snippets.

@Nitewriter
Nitewriter / keybase.md
Last active January 3, 2018 14:18
keybase.md

Keybase proof

I hereby claim:

  • I am nitewriter on github.
  • I am nitewriter (https://keybase.io/nitewriter) on keybase.
  • I have a public key ASAnHGBJ2RcNOvNKYS9bSG-7YHw3eBo-SlxFYd6vRyF9pAo

To claim this, I am signing this object:

@Nitewriter
Nitewriter / hockeyapp_upload.sh
Last active November 13, 2015 16:41
HockeyApp Upload Script
#!/bin/bash
# Markdown change log for the last 20 commits
CHANGE_LOG=$(git log --pretty=format:"* %s" --no-merges --no-color -n 20)
echo CHANGE_LOG
curl \
-F "status=2" \
-F "notify=1" \
-F "notes=$CHANGE_LOG" \
#import "NSData+Hash.h"
#import <CommonCrypto/CommonDigest.h>
@implementation NSData (Hash)
- (NSData *)SHA1
{
unsigned char hash[CC_SHA1_DIGEST_LENGTH];
if (CC_SHA1([self bytes], [self length], hash))
{
@Nitewriter
Nitewriter / ViewController.m
Created October 26, 2011 15:11
UIWebview: BaseURL
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSData *HTMLData = [NSData dataWithContentsOfFile:path];
NSString *HTMLString = [[[NSString alloc] initWithData:HTMLData encoding:NSUTF8StringEncoding] autorelease];
NSString *baseURLString = [[NSBundle mainBundle] resourcePath];
NSURL *baseURL = [NSURL fileURLWithPath:baseURLString isDirectory:YES];
@Nitewriter
Nitewriter / MyAppDelegate.m
Created September 30, 2011 13:56
UINavigationController custom navigation bar
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Create a new window and assign directly to provided iVar
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Implementation of new init method
MyCustomNavigationBar *navigationBar = [[MyCustomNavigationBar alloc] initWithFrame:CGRectZero];
UINavigationController *navigationController = [[UINavigationController alloc] initWithCustomNavigationBar:navigationBar];
@Nitewriter
Nitewriter / TestAppDelegate.m
Created July 25, 2011 19:24
#iOS: Nib-less Tab Bar Controller setup
//...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Create a new window and assign directly to provided iVar
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Set background for window if desired