Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Lex Tang lexrus

🏠
Working from home
Block or report user

Report or block lexrus

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
@lexrus
lexrus / WTF_YOU_MUST_UPGRADE_COCOAPODS.sh
Created May 28, 2014
Force your little brother to upgrade CocoaPods.
View WTF_YOU_MUST_UPGRADE_COCOAPODS.sh
NEW_VER="0.33.1"
POD_VER=`pod --version 2>/dev/null`|| POD_VER=`~/.rbenv/shims/pod --version 2>/dev/null`
if [[ "$POD_VER" != *$NEW_VER ]]; then
echo "error: WTF! You MUST upgrade cocoapods!!!"
exit 1
fi
@lexrus
lexrus / chinadns.conf
Created Jul 23, 2014
supervisor config for chinadns
View chinadns.conf
[program:chinadns]
command=/usr/local/bin/chinadns
numprocs=1
autostart=true
autorestart=unexpected
startsecs=2
startretries=3
stdout_logfile=/var/log/chinadns.log
stdout_logfile_maxbytes=2MB
stderr_logfile=/var/log/chinadns.error.log
@lexrus
lexrus / svg2png.sh
Created Mar 31, 2015
Convert svg files to png.
View svg2png.sh
for f in *.svg; do cairosvg $f -f png -o $f.png; done
@lexrus
lexrus / Deliverfile.rb
Created Apr 3, 2015
Universal Change Log
View Deliverfile.rb
changelog({
"cmn-Hans" => "感谢使用 VPN On!为改善用户使用体验,我们每隔一周就会在 App Store 更新应用。你可以前往手机“设置”>“iTunes 与 App Store”>“自动下载的项目”,打开“更新”。\n\nVPN On 应用的每次更新都会改进速度和稳定性。一有新功能推出,我们会在应用中提示你。",
"cmn-Hant" => "感謝使用 VPN On!爲改善用戶使用體驗,我們每隔一週就會在 App Store 更新應用。你可以前往手機“設置”>“iTunes 與 App Store”>“自動下載的項目”,打開“更新”。\n\nVPN On 應用的每次更新都會改進速度和穩定性。一有新功能推出,我們會在應用中提示你。",
"ja-JP" => "VPN Onをご利用いただきありがとうございます。VPN Onではアプリをより快適にご利用いただくため、アプリストアで隔週でアップデートを行っております。[設定] > [iTunes & App Store] > [自動ダウンロード]でアップデートをオンにすることで、自動的に(このページにアクセスすることなく)アプリをアップデートいただけます。 \n\nVPN Onアプリのアップデートではスピードと信頼性の向上が行われており、また新しい機能が追加されると、アプリ内でその機能がハイライトされます。",
"it-IT" => "Grazie di usare VPN On! Per migliorare la nostra applicazione, pubblichiamo aggiornamenti nell'App Store ogni 2 settimane. Puoi aggiornare l'applicazione automaticamente (senza dover tornare qui) accedendo a Impostazioni > iTunes Store e App Store > Download automatici e attivando Aggiornamenti. \n\nOgni aggiornamento della nostra applicazione VPN On presenta miglioramenti relativi a velocità e aff
@lexrus
lexrus / gist:1834804
Created Feb 15, 2012
BundleFullVersion
View gist:1834804
NSString *appVersion = [NSString stringWithFormat:@"%@(%@)",
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
@lexrus
lexrus / tc
Created Mar 15, 2012
Epoch / Unix Timestamp Converter
View tc
#!/bin/bash
# sudo chmod +x tc;sudo mv tc /usr/bin
if [[ -z "$1" ]]
then
printf %s "\
Nifty Timestamp Convertor by Lex Tang
tc 2012/12/12
tc 1355283413
"
exit
@lexrus
lexrus / NSLogger+TestFlight.h
Created Mar 19, 2012
NSLogger+TestFlight Macros with remote log trigger
View NSLogger+TestFlight.h
#pragma mark - NSLogger+TestFlight
#ifdef ADHOC
#import "TestFlight.h"
#define LOG_NETWORK(level, format, ...) TFLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOG_GENERAL(level, format, ...) TFLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOG_GRAPHICS(level, format, ...) TFLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOG_MEMORY(level, format, ...) TFLog((@"%s [Line %d] " format), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#define LOG_IMAGE(level, format, ...) do{}while(0)
#else
#if 0 // REMOTE LOG
@lexrus
lexrus / Makefile
Created Mar 30, 2012 — forked from hiroshi/Makefile
Makefile for Testflight upload
View Makefile
# Testflight web interface doesn't allow input non-ASCII characters (e.g. Japanese) with Safari!
BROWSER = Safari
TESTFLIGHT_TEAM_TOKEN_FILE = ./.testflight_team_token
TESTFLIGHT_TEAM_TOKEN_URL = https://testflightapp.com/dashboard/team/edit/?next=/api/doc/
TESTFLIGHT_TEAM_TOKEN = $(shell cat $(TESTFLIGHT_TEAM_TOKEN_FILE))
TESTFLIGHT_API_TOKEN_FILE = ~/.testflight_api_token
TESTFLIGHT_API_TOKEN_URL = https://testflightapp.com/account/\#api-token
TESTFLIGHT_API_TOKEN = $(shell cat $(TESTFLIGHT_API_TOKEN_FILE))
TESTFLIGHT_NOTES = 'This build was uploaded via the upload API'
#TESTFLIGHT_OTHER_OPTIONS = -F replace=True
View .gitignore
# Exclude the Podspecs
Pods/*
Podfile.lock
# Exclude any PSD/AI source
#*.psd
#*.ai
# Exclude generated files
VersionX-revision.h
@lexrus
lexrus / appstore.sh
Created Oct 22, 2012
Switch keychains for InHouse & AppStore while both certifications have the same name
View appstore.sh
#!/bin/bash
export MM_KEYCHAIN=(~/Dropbox/mm.keychain)
export MM_INHOUSE_KEYCHAIN=(~/Dropbox/mm_inhouse.keychain)
cp "$MM_INHOUSE_KEYCHAIN" "$MM_INHOUSE_KEYCHAIN.ori"
security delete-keychain "$MM_INHOUSE_KEYCHAIN"
if [[ -f "$MM_KEYCHAIN.ori" ]]; then
You can’t perform that action at this time.