Skip to content

Instantly share code, notes, and snippets.

Rob Keniger rkeniger

Block or report user

Report or block rkeniger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tanner0101 / NSDataExtensions.swift
Last active Feb 3, 2017
Convert to and from NSData for common Swift types. Includes Eddystone URL conversion.
View NSDataExtensions.swift
// NSData.swift
// Pods
// Created by Tanner Nelson on 9/15/15.
import Foundation
JadenGeller / Arbitrary Precision and Arbitrary Base Integers Example.swift
Last active Sep 12, 2018
Swift Arbitrary Precision, Arbitrary Base Integers
View Arbitrary Precision and Arbitrary Base Integers Example.swift
// Use an integer literal to instantiate
let a: BigInt = 23559821412349283
// Or use a string literal if you want to start with a number that is greater than IntMax
let b: BigInt = "123456789876543234567876543234567876543"
// Perform arithmetic operations
let c: BigInt = 123456 + 321 // -> 12777
let d = c / 100 // -> 127
let e = d << d // -> 12700000000......(127 zeros)
ideabucket / Reflow
Last active May 8, 2019
BBEdit text filter to replace Markup → Tidy → Reflow XML
View Reflow
#!/usr/bin/env bash
# put this file in Application Support/BBedit/Text Filters/
# xmllint ships by default in recent versions of OS X
xmllint --format -
nilium / WorkQueue.swift
Last active Aug 29, 2015
Basic Swift enum to wrap different types of work queues.
View WorkQueue.swift
// Copyright Noel Cower 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
import Foundation
/// Asynchronous WorkQueue scheduling operator.
staltz /
Last active Oct 20, 2019
The introduction to Reactive Programming you've been missing
rob-murray /
Last active Aug 14, 2018
Use agvtool to set Xcode project build number
# Use agvtool to set Xcode project build number and create git tag
# Note: requires Xcode project configured to use Apple Generic Versioning and git
# Usage: 123
# src:
mipstian / UICollectionView+ReloadItemsAnimated.h
Created Jan 19, 2013
UICollectionView category to disable animation on reloadItemsAtIndexPaths:
View UICollectionView+ReloadItemsAnimated.h
#import <UIKit/UIKit.h>
@interface UICollectionView (ReloadItemsAnimated)
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths animated:(BOOL)animated;
bdkjones / safesleep.txt
Created Nov 12, 2012
Disabling Safe Sleep After November, 2012
View safesleep.txt
In early November, 2012, Apple issued a graphics update for all mid-2012 MacBooks. In a continued streak of stupidity, however, this update forces your Mac to use "Safe Sleep". This means that the entire contents of your RAM is written to your disk every time you put your Mac to sleep.
This is retarded on the scale of the Titanic's navigational plan for two reasons:
1) Your Mac likely has 8 or 16GB of RAM. This is a ton of wasted disk space; especially on MacBook Airs that ship with only 256GB SSDs to begin with.
2) SSDs wear out as you write to them. Each cell of a SSD can only be written to a certain number of times before it becomes read-only. If you put your computer to sleep many times a day, OS X is slowly but surely destroying your SSD with unneeded write cycles.
Worst of all, the graphics update makes it IMPOSSIBLE to turn off safe sleep using the standard approach you'll find on Google:
kimhunter / compare_dispatch_apply.m
Created Nov 6, 2012
Compare Dispatch Concurrent to for loop
View compare_dispatch_apply.m
#import <Foundation/Foundation.h>
#define LOGV(V) NSLog(@"%s = %@", #V, V);
#define LOGD(I) NSLog(@"%s = %d", #I, I);
int main(int argc, const char * argv[])
dispatch_queue_t dqueue = NULL;
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

You can’t perform that action at this time.