Skip to content

Instantly share code, notes, and snippets.


Zigii Wong wongzigii

Block or report user

Report or block wongzigii

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
View gist:5e752aad35c466b02b0852890cde6889
### Keybase proof
I hereby claim:
* I am wongzigii on github.
* I am wongzigii ( on keybase.
* I have a public key ASCn8Mg_ycB69aLhl5yqh9KBIc7kx_ted1_YDWtnWYh8Qwo
To claim this, I am signing this object:
wongzigii /
Created Jan 22, 2019
Reset Xcode AppStore transporter
cd ~
rm -rf .old_itmstransporter/
mv .itmstransporter/ .old_itmstransporter/
wongzigii / mongo-docker.bash
Created Dec 7, 2018 — forked from davideicardi/mongo-docker.bash
Running mongodb inside a docker container (with mongodb authentication)
View mongo-docker.bash
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (
# add a root user
wongzigii /
Created Aug 25, 2018 — forked from jeremy-w/
Converting a std::vector into an NSArray
//clang++ -std=c++11 -stdlib=libc++ -framework Foundation -o nsarray
/* Note:
* - libstdc++ has been frozen by Apple at a pre-C++11 version, so you must opt
for the newer, BSD-licensed libc++
* - Apple clang 4.0 (based on LLVM 3.1svn) does not default to C++11 yet, so
you must explicitly specify this language standard. */
/* @file
* @author Jeremy W. Sherman
* Demonstrates three different approaches to converting a std::vector
wongzigii / UIScrollView with masonry
Created Oct 12, 2017 — forked from 0oneo/UIScrollView with masonry
vertical and Horizontal scrollview using masonry
View UIScrollView with masonry
@interface ViewController ()
@property (strong, nonatomic) UIScrollView* vScrollView;
@implementation ViewController
- (void)viewDidLoad
[super viewDidLoad];
wongzigii /
Last active Aug 14, 2017
Choose ”Copy transcripts for shown results”, then in Terminal run this script and you will get the 10th longest compile time.
pbpaste | egrep '\.[0-9]+ms' | sort -t "." -k 1 -n | tail -10
wongzigii / RemoveXcodeCommentHeader.txt
Last active May 15, 2017
Find this RegExp and replace empty string to remove all template comment headers in your Xcode project
View RemoveXcodeCommentHeader.txt
//\n//.+\n//.+\n//\n//.+\n// Copyright.+$\n//\n\n
wongzigii /
Last active Jan 12, 2018
Remove useless header comments from Xcode templates
find -E $(xcode-select --print-path) -regex '.*___\.(c|h|m|swift)' -print0 | xargs -0 -n 1 sed -i '' '1,/^$/d'
View CoreDataDatabaseCleanup.m
For example, you use Core Data sqlite.
It is necessary, because sqlite database stores data in single file.
Whole database is single file.
Now you have two options.
1. Delete all data from all tables
2. Delete database sqlite file
Second option is clean but complex.
wongzigii / magicalrecord_reset_coredata.m
Created Mar 21, 2017 — forked from binho/magicalrecord_reset_coredata.m
MagicalRecord remove and reset CoreData
View magicalrecord_reset_coredata.m
- (void)resetCoreData {
DDLogInfo(@"[RESET-COREDATA] Started.");
[MagicalRecord cleanUp];
NSURL *storeURL = [NSPersistentStore MR_urlForStoreName:kMobilStoreName];
NSURL *walURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-wal"];
NSURL *shmURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-shm"];
You can’t perform that action at this time.