Skip to content

Instantly share code, notes, and snippets.

View alexlee002's full-sized avatar

Alex Lee alexlee002

  • Nil
  • Unknown
View GitHub Profile
@alexlee002
alexlee002 / switch_pod_repo.sh
Created February 10, 2015 10:14
Switch Cocoapods' repo mirrors
#!/bin/sh
function usage()
{
echo -e "Usage:\n\t$(basename $0) offical|gitcafe|oschina|<other repo url>\n\n"
}
#######################################
if [[ $# -lt 1 ]]; then
usage;exit
@alexlee002
alexlee002 / Singleton_Template.h
Last active September 20, 2015 12:32
A safe Objective-C singleton implementation. All instance method such as [[Singleton alloc] init], [[Singletion allocWithZone:zone] init]; [Singleton sharedInstance] are return the same instance and you can call them multi-times.
//
// Singleton_Template.h
//
// Created by Alex Lee on 3/11/15.
//
#undef AS_SINGLETON
#define AS_SINGLETON \
+ (instancetype)sharedInstance; \
@alexlee002
alexlee002 / xcplugin_update.sh
Created April 11, 2015 19:50
Auto update Xcode plugins to support new version of Xcode
#!/bin/sh
PLUGINS_DIR="$HOME/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
XCODE_INFO_PATH=$(xcode-select -p)
XCODE_INFO_PATH=$(dirname "$XCODE_INFO_PATH")/Info
DVTPlugInCompatibilityUUID=$(defaults read "$XCODE_INFO_PATH" DVTPlugInCompatibilityUUID)
for plugin in "$PLUGINS_DIR"/*.xcplugin; do
plugin_info_path="$plugin/Contents/Info"
if [[ -f "$plugin_info_path.plist" ]]; then
"""
Prerequisites:
$ pip install biplist
$ pip install requests
Usage:
python dsym_symbolizer.py --dsym_url https://www.example.com/MyStuff.framework.dSYM.zip \
--source_path /Users/MeMySelfAndI/MyStuffSources \
--binary_path /Users/MeMySelfAndI/MyProject/Pods/MyStuff/MyStuff.framework
"""
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
/// define an operation success or error result
enum Result<T> {
case error(Error)
case success(T)
}