Skip to content

Instantly share code, notes, and snippets.

Darcy Liu darcyliu

Block or report user

Report or block darcyliu

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
rcabaco / gist:6765778
Created Sep 30, 2013
UITextView subclass to handle up/down cursor movement
View gist:6765778
// Code to handle up/down cursor motion in a UITextView.
// Based on code from OmniGroup's OUITextView
#import "TextView.h"
@interface TextView ()
ryanjbonnell / gist:3880048
Last active Apr 19, 2018
Install Memcache on Mac OS X 10.8 "Mountain Lion"
View gist:3880048
# memcached requires libevent
cd /usr/local/src
curl -L -O
tar -xvzf libevent-2.0.17-stable.tar.gz
cd libevent-2.0.17-stable*
sudo make install
# Compile memcached utility
snikch / gist:3661188
Created Sep 6, 2012
Find the current top view controller for your iOS application
View gist:3661188
- (UIViewController *)topViewController{
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController];
- (UIViewController *)topViewController:(UIViewController *)rootViewController
if (rootViewController.presentedViewController == nil) {
return rootViewController;
fermion /
Created Mar 2, 2012 — forked from scotttam/
Sends an Apple Push Notification with Python
import socket, ssl, json, struct
import binascii
# device token returned when the iPhone application
# registers to receive alerts
deviceToken = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62'
thePayLoad = {
'aps': {
'alert':'Oh no! Server\'s Down!',
dvessel / gist:1478685
Created Dec 14, 2011
TextMate 2 .tm_properties
View gist:1478685

This is all based on the [alpha release][1].


From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

jtowle / gist:1174024
Created Aug 26, 2011
Newsstand App Delegate's applicationDidFinishLaunchingWithOptions
View gist:1174024
* In application:DidFinishLaunchingWithOptions:
// Set up newsstand helper
// newsstand is an ivar - you will need to declare it in your header and
// release it in dealloc
newsstand = [[UANewsstandHelper alloc] init];
christian-oudard /
Created Jun 29, 2010
Github Flavored Markdown in Python
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(
extractions[digest] =
return "{gfm-extraction-%s}" % digest
You can’t perform that action at this time.