Skip to content

Instantly share code, notes, and snippets.

View crespoxiao's full-sized avatar

Chengfei Xiao crespoxiao

View GitHub Profile
#import <Foundation/Foundation.h>
@interface NSString (CFXValidateURL)
- (BOOL)cfx_validateUrl;
- (BOOL)cfx_validateUrl_RegEx;
@end
@crespoxiao
crespoxiao / gist:3d033f71e9a94ce7b5a9bb48ca29dc34
Last active September 7, 2016 03:34
example shell for batch rename files (change the first 4 char of file name to DRC)
#!/bin/bash
currentDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
echo "current path is:"$currentDir;
list_alldir(){
for file2 in `ls -a $1`
do
if [ x"$file2" != x"." -a x"$file2" != x".." ];then
@crespoxiao
crespoxiao / AlertClass
Created December 30, 2013 13:27
this is CrespoXiao's gists
//
// TCNetworkAlertView.h
// KanKanIphone
//
// Created by CrespoXiao on 13-11-26.
//
//
#import <UIKit/UIKit.h>
//
// ONEObserverStore.h
// OneTravel
//
// Created by xiaochengfei on 15/8/18.
// Copyright (c) 2015年 Didi.Inc. All rights reserved.
//
#import <ONEBaseStore/ONEBaseStore.h>
@interface ApplicationDelegate<UIApplicationDelegate>
@end
@implementation ApplicationDelegate
- (RACSignal *)rac_registeredForRemoteNotifications {
RACSignal *signal = objc_getAssociatedObject(self, _cmd);
if (signal != nil) return signal;
RACSignal *didRegisterForRemoteNotification = [[self rac_signalForSelector: @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:) fromProtocol: @protocol(UIApplicationDelegate)] map: ^(RACTuple *tuple) {
return tuple.second;
@crespoxiao
crespoxiao / gist:53f9d4006ab2a90de543
Created November 24, 2014 07:15
build_ffmpeg_ios_armv7_armv7s_arm64_i386_x84_64.sh
#!/bin/sh
# directories
SOURCE="ffmpeg-2.4.3"
FAT="FFmpeg-iOS"
SCRATCH="scratch"
# must be an absolute path
THIN=`pwd`/"thin"
# absolute path to x264 library
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年前的工程'},
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2
//http://blog.xcodev.com/archives/send-sms-via-iphone-baseband/
#import <Foundation/Foundation.h>
#import <termios.h>
#import <time.h>
#import <sys/ioctl.h>
@implementation NSString(UCS2Encoding)
//http://blog.xcodev.com/archives/access-iphone-simcard-contacts-via-baseband/
#import <Foundation/Foundation.h>
#import <termios.h>
#import <time.h>
#import <sys/ioctl.h>
//UCS2编码支持
@implementation NSString(UCS2Encoding)