Skip to content

Instantly share code, notes, and snippets.

View robyzhou's full-sized avatar

robyzhou robyzhou

  • Tencent
  • chengdu, china
View GitHub Profile
@ameesters
ameesters / quick-check.py
Created October 25, 2012 14:35
A python script that checks multiple websites status.
#!/usr/bin/env python
import os, time, httplib
from termcolor import colored
SITES = [
"www.meesters-id.nl",
"www.carolsingers.nl",
]
while 1:
@weekwood
weekwood / JailBreakCheck.mm
Created December 12, 2012 21:15
Check if iPhone jailbreak or not
+(BOOL) jailBreakCheck{
NSArray *jailbrokenPath = [NSArray arrayWithObjects:
@"/Applications/Cydia.app",
@"/Applications/RockApp.app",
@"/Applications/Icy.app",
@"/usr/sbin/sshd",
@"/usr/bin/sshd",
@"/usr/libexec/sftp-server",
@"/Applications/WinterBoard.app",
@"/Applications/SBSettings.app",
@heroicyang
heroicyang / ios_resources.json
Created October 9, 2013 02:33
GitHub 上的 iOS 开源项目
var githubList = [
{
name:'系统基础库',
list: [
{name:'Category/Util',
list: [
{name:'sstoolkit', owner:'soffes', desc:'一套Category类型的库,附带很多自定义控件 功能不错~'},
{name:'BlocksKit', owner:'pandamonia', desc:'将Block风格带入UIKit和Founcation'},
{name:'cocoa-helpers', owner:'enormego', desc:'一些Cocoa的扩展 2年前的工程'},
@steipete
steipete / PSPDFThreadSafeMutableDictionary.m
Created December 2, 2013 09:00
Dictionary subclass whose primitive operations are thread safe. Most of the time you don't want locking at the collection level, but there are valid use cases for this, and it's interesting how to properly subclass the NSDictionary class cluster. We're using SpinLocks here, since it's highly unlikely that any of the operation locks for more than…
@interface PSPDFThreadSafeMutableDictionary : NSMutableDictionary
@end
#import "PSPDFThreadSafeMutableDictionary.h"
#import <libkern/OSAtomic.h>
@implementation PSPDFThreadSafeMutableDictionary {
OSSpinLock _lock;
NSMutableDictionary *_dictionary; // Class Cluster!
@nonamelive
nonamelive / DMNavigationController.m
Last active April 21, 2023 06:56
Prevent UINavigationController from pushing two view controllers at the same time in case of stack inconsistency and crashes
@interface UINavigationController (DMNavigationController)
- (void)didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
@end
@interface DMNavigationController ()
@property (nonatomic, assign) BOOL shouldIgnorePushingViewControllers;
@123nobody
123nobody / UIButton+Extensions.h
Created April 10, 2014 06:25
Making UIButton's hit area larger than the default hit area
@interface UIButton (Extensions)
@property(nonatomic, assign) UIEdgeInsets hitTestEdgeInsets;
@end