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 / gist:1834804
Created Feb 15, 2012
View gist:1834804
NSString *appVersion = [NSString stringWithFormat:@"%@(%@)",
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
lexrus /
Created Mar 6, 2012
AppStore Icons Generator
# According to
# Install ImageMagick with MacPort: sudo port install ImageMagick
convert $1 -resize 512x512 iTunesArtwork.png # Ad Hoc iTunes
convert $1 -resize 144x144 Icon-72@2x.png # Home screen for "The New iPad"
convert $1 -resize 114x114 Icon@2x.png # Home screen for Retina display iPhone/iPod
convert $1 -resize 72x72 Icon-72.png # App Store and Home screen on iPad
convert $1 -resize 58x58 Icon-Small@2x.png # Spotlight and Settings for Retina display
convert $1 -resize 57x57 Icon.png # Home screen on non-Retina iPhone/iPod
convert $1 -resize 50x50 Icon-Small-50.png # Spotlight on iPad 1/2
lexrus / tc
Created Mar 15, 2012
Epoch / Unix Timestamp Converter
View tc
# sudo chmod +x tc;sudo mv tc /usr/bin
if [[ -z "$1" ]]
printf %s "\
Nifty Timestamp Convertor by Lex Tang
tc 2012/12/12
tc 1355283413
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)
#if 0 // REMOTE LOG
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_API_TOKEN_FILE = ~/.testflight_api_token
TESTFLIGHT_NOTES = 'This build was uploaded via the upload API'
View .gitignore
# Exclude the Podspecs
# Exclude any PSD/AI source
# Exclude generated files
lexrus /
Created Oct 22, 2012
Switch keychains for InHouse & AppStore while both certifications have the same name
export MM_KEYCHAIN=(~/Dropbox/mm.keychain)
export MM_INHOUSE_KEYCHAIN=(~/Dropbox/mm_inhouse.keychain)
security delete-keychain "$MM_INHOUSE_KEYCHAIN"
if [[ -f "$MM_KEYCHAIN.ori" ]]; then
lexrus /
Last active Oct 13, 2015 — forked from rjyo/
OTA builder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import json
import getopt
import urllib2
import commands
import string
lexrus / FREEDOM.wsf
Created Dec 24, 2012
有些变态的公司不让员工安装一些 Windows 常用软件~ 这个脚本帮助你骗过运维的远程注册表扫描程序,“非法”安装一些应用。运行后会在桌面上生成已经安装的软件列表,选择哪些要假装删除,然后运行桌面上的这个脚本,运维就扫描不到了。
View FREEDOM.wsf
<job id="TheShawshankHammer">
<script language="JScript" id="env">
var fso = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = WScript.CreateObject("WScript.Shell");
var deskPath = WshShell.SpecialFolders("Desktop");
var arg = WScript.Arguments;
var scriptPath = WScript.ScriptFullName.split('\\').slice(0, -1).join('\\') + '\\';
<script language="JScript" id="scan">
lexrus / muzix.html
Created Dec 24, 2012
My XLST table sorting demo. Required IE 5.0+
View muzix.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head><title>LeXRus' CodeX | XMLDOM | Transform a XML file with XSLT &amp; XMLDOM</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script xmlns:query=""><!--//XR.Web.Request.Query["expr.(string)"]
var from,num,select,order,sort;
select=window.location.href.replace(/.*\?.*select=([ \w@=\(\)\[\]\.\*\\\/]+).*/i,"$1").toString();//the Filter of strXPath
You can’t perform that action at this time.