Skip to content

Instantly share code, notes, and snippets.

View thuai's full-sized avatar
🎯
Focusing

TT thuai

🎯
Focusing
View GitHub Profile
@thuai
thuai / default
Created December 9, 2017 14:46 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@thuai
thuai / new_gist_file
Created August 31, 2016 02:53
iOS CALayer 的 pause 和 resume
// 使用CABasicAnimation时,如果需要暂停动画、恢复动画时可以通过pauseLayer
- (void)pauseLayer:(CALayer*)layer {
if (layer.speed == 0.0) {
return;
}
CFTimeInterval pausedTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
layer.speed = 0.0;
layer.timeOffset = pausedTime;
}
# https://gist.github.com/gists/1876339
*.DS_Store
# ignore Xcode compiled build folder and application.
*build
*.app
# ignore Xcode User .pbxuser and .mode1v3 files.
*.pbxuser
*.mode1v3
#!/bin/sh
source ~/.bash_profile
hash oclint > /dev/null
if [ $? -eq 1 ]; then
echo > "oclint not found, analyzing stopped"
exit 1
fi
cd ${TARGET_TEMP_DIR}
// Author: Oleg Andreev <oleganza@gmail.com>
// May 28, 2011
// Do What The Fuck You Want Public License <http://www.wtfpl.net>
#import "NSData+OADataHelpers.h"
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
//
// NSData+HG_DataHealing.h
// HGDataHealing
//
// Created by 缪 和光 on 14-3-7.
// Copyright (c) 2014年 Hokuang. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDate (PrettyDate)
- (NSString *)prettyDate;
@end
#!/bin/sh
echo "======================"
echo "Auto backup archive file [start]"
echo "Configuration [$CONFIGURATION]"
if [ "$CONFIGURATION" == "Debug" ]; then
echo "Skipping configuration debug"
echo "======================"
exit 0;
@thuai
thuai / Abstract_Methods
Created June 16, 2014 06:53
Create Abstract Methods
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]
userInfo:nil];
@thuai
thuai / 0_reuse_code.js
Created June 16, 2014 02:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console