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
View gist:926659
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" xml:lang="en" lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="jquery-1.4.3.js"></script>
View gist:930669
<!DOCTYPE html>
<meta charset="utf-8">
<title>auto center</title>
width: 500px;
border: 2px solid #777;
padding: 5px;
darcyliu / gist:931733
Created Apr 20, 2011
Google Page Rank
View gist:931733
#!/usr/bin/env python
# Script for getting Google Page Rank of page
# Google Toolbar 3.0.x/4.0.x Pagerank Checksum Algorithm
# original from
# this version was adapted from
# by Corey Goldberg - 2010
# Licensed under the MIT license:
View NSString+Split.h
// NSString+Split.h
// Categories
// Created by Darcy Liu on 6/17/12.
// Copyright (c) 2012 Close To U. All rights reserved.
#import <Foundation/Foundation.h>
View gist:3063695
*@fileOverview gravator proxy
* reuqire node.js v0.6.7
var HOST = '';
var PORT = 1337;
var HOST = HOST||'';
var PORT = PORT||80;
darcyliu / Singleton.h
Created Aug 18, 2012
Objective-C Singleton Demo
View Singleton.h
#import <Foundation/Foundation.h>
@interface Singleton : NSObject
darcyliu / gist:4498998
Created Jan 10, 2013
Delete Unversioned Files Under SVN
View gist:4498998
#Show Unversioned Files
svn status --no-ignore | grep '^\?' | sed 's/^\? //'
#Delete Unversioned Files
svn status --no-ignore | grep '^\?' | sed 's/^\? //' | xargs -Ixx rm -rf xx
darcyliu / gist:4499023
Created Jan 10, 2013
svn global ignores for xcode
View gist:4499023
#vim ~/.subversion/config
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
*.rej *~ #*# .#* .*.swp .DS_Store *.xcuserdatad
darcyliu / gist:5496717
Created May 1, 2013
Core Data Snippets
View gist:5496717
//1 Creating a New Managed Object Context
//To create a new managed object context, you need a persistent store coordinator.
NSPersistentStoreCoordinator *psc = <#Get the coordinator#>;
NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init];
[newContext setPersistentStoreCoordinator:psc];
//using the same coordinator as the existing one
NSManagedObjectContext *context = <#Get the context#>;
NSPersistentStoreCoordinator *psc = [context persistentStoreCoordinator];
NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init];
memcached -d -l -p 11211 -m 64
You can’t perform that action at this time.