This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSObject (BDWRuntime) | |
- (void)bdw_attachObject:(id)obj forKey:(NSString *)key; | |
- (id)bdw_getAttachedObjectForKey:(NSString *)key; | |
- (void)bdw_attachObject:(id)obj forKey:(NSString *)key isWeak:(BOOL)bWeak; | |
- (id)bdw_getAttachedObjectForKey:(NSString *)key isWeak:(BOOL)bWeak; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)makeAnimatedGif:(NSArray *)images filePath:(NSString *)filePath ration:(CGFloat)ration | |
{ | |
NSInteger count = images.count; | |
CGImageDestinationRef destination; | |
CFURLRef url = CFURLCreateWithFileSystemPath( | |
kCFAllocatorDefault, | |
(__bridge CFStringRef)filePath, | |
kCFURLPOSIXPathStyle, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
typedef void (^RCTaskBlock)(NSString *keyPath, id object, NSDictionary *change); | |
@interface TZReceptionist : NSObject | |
+ (id)receptionistForKeyPath:(NSString *)path | |
object:(id)obj | |
queue:(NSOperationQueue *)queue | |
task:(RCTaskBlock)task; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
phone number regex | |
-------------------''' | |
def isPhoneNumber(text): | |
if len(text) != 12: | |
return False #not phone number-sized | |
for i in range(0, 3): | |
if not text[i].isdecimal(): | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set hlsearch | |
set incsearch | |
set ignorecase | |
set smartcase | |
set scrolloff=3 | |
imap jj <Esc> | |
" Window operation | |
nnoremap <Space>ww <C-W>w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %C(blue)%s%Creset %C(dim cyan)<%an>%Creset %C(dim white)(%ci)%Creset' --abbrev-commit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Check test code | |
v=$(git diff | grep -i -e '^\+.*paul' -e '^\+.*//.*@test' -e '^\+.*/\*.*@test') | |
if [ "x$v" != "x" ] | |
then | |
echo "\033[31m Commit Failed! *** Reason: Test codes are added! *** \033[0m" | |
echo "$v" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Check test code | |
v=$(svn diff | grep -i -e '^\+.*paul' -e '^\+.*//.*@test' -e '^\+.*/\*.*@test' -e '^\+.*DevelopmentTeam\s*=\s*') | |
if [ "x$v" != "x" ] | |
then | |
echo "\033[31m Commit Failed! *** Reason: Test codes are added! *** \033[0m" | |
echo "$v" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on open of listFile set srcFile to the first item of listFile set myFolderName to "Payload" set wechatFileName to "wechat.ipa" tell application "Finder" if not (exists folder myFolderName of desktop) then set wechatItem to make new folder at desktop with properties {name:myFolderName} end if duplicate srcFile to folder myFolderName of desktop with replacing --set itemPath to POSIX path of (folder "Wechat" of desktop as alias) --set thePath to POSIX path of (desktop as alias) & "Wechat.zip" --do shell script "zip -r " & quoted form of thePath & " " & quoted form of itemPath do shell script "cd ~/desktop && zip -r " & wechatFileName & " " & myFolderName delay 1 delete folder myFolderName delay 1 beep tell application "Google Chrome" activate set theUrl to "http://rdm.wsd.com/sign.jsp" if (count every window) = 0 then make new window end if set found to false set theTabIndex to -1 repeat with theWindow in every window set theTabIndex to 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Example aliases |