Skip to content

Instantly share code, notes, and snippets.

View cezheng's full-sized avatar

Ce Zheng cezheng

  • Sunnyvale, California
View GitHub Profile
@cezheng
cezheng / memo.md
Last active August 10, 2016 13:22
C++11 behaviour memo

Scoped static variable

Constructed the first time the program goes to the line of its declaration. Thread safe.

#include <iostream>

class A {
public:
  A(int i) {
    std::cout<<"constructor"<<i<<std::endl;
@cezheng
cezheng / gist:078f55958443a5aaf55429f1b1671165
Created June 24, 2016 08:50
for debugging a specific signal handler in Xcode
process handle SIGABRT -p true -s false
@cezheng
cezheng / BugSample.swift
Created June 22, 2016 10:01
Swift 3 Collection protocol bug on Xcode 8 beta
// Copy the following code into a playground on Xcode 8 beta
import Foundation
class CustomCollection: Collection {
typealias Index = Int
typealias IndexDistance = Int
private(set) var count: Int
private var cursor = 0
@cezheng
cezheng / setDefaultBrowser.swift
Last active June 15, 2016 12:44
Setting default browser on OSX (swift 2.2)
#!/usr/bin/swift
import Foundation
import CoreServices
let bundleId: CFString = "xxx.xxx.xxx" as NSString
LSSetDefaultHandlerForURLScheme("http" as NSString, bundleId)
LSSetDefaultHandlerForURLScheme("https" as NSString, bundleId)
@cezheng
cezheng / gist:6fde572d1b25cab7275c92ca414709a4
Created May 23, 2016 12:06
Android Studio 2.2 preview 1 test cocos2d-x
2016-05-23 21:03:15,812 [ 9312] INFO - tor.impl.FileEditorManagerImpl - Project opening took 5080 ms
2016-05-23 21:03:24,390 [ 17890] INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.13-all.zip'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:59)
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
@cezheng
cezheng / gist:89bf38627a5a2c04c64dc92844b5440a
Created April 14, 2016 09:18
list directories greater than a given size
du -sm * | awk '$1 > 1000'

袜子那个,打算买这些:

size:170的身高。L-LL 色:黑或浅肤色(即肤色偏白),例如atsugi的フレッシュベージュ(320)或323,gunze的浅肤色389,kanebo的FBE,fukuske的323 原则:宁缺毋滥,不对就不买。我在amazon上面看到都是多双一起,那种,因为不知道好不好,宁愿多买几款而非同款同色买n个。而且,tights或panty是带裤裆的,stocking是不带的,就圣诞老人那种,但amazon上面有的stocking其实是tights。

明细:

1.品牌:アツギ

@cezheng
cezheng / gist:46a4d770b293e32fc697
Created December 30, 2015 10:50
ubuntu keymap
setxkbmap -option ctrl:nocaps
@cezheng
cezheng / gist:264c1e3624731779ac76
Created November 27, 2015 06:38
Xcode Parallel compiling
defaults write com.apple.XCode PBXNumberOfParallelBuildSubtasks 6
1 <1 ms <1 ms <1 ms 192.168.1.1
2 2 ms 2 ms 2 ms tky2gm1.vectant.ne.jp [163.139.100.35]
3 2 ms 3 ms 2 ms 163.139.154.1
4 4 ms 2 ms 3 ms 163-139-68-133.rv.vectant.ne.jp [163.139.68.133]
5 3 ms 4 ms 3 ms ae28.core2.nihonbashi.vectant.ne.jp [163.139.130.157]
6 6 ms 8 ms 6 ms ae0.core1.otemachi.vectant.ne.jp [163.139.128.54]
7 13 ms 10 ms 12 ms ae-2.a21.tokyjp01.jp.ra.gin.ntt.net [61.213.160.109]
8 9 ms 10 ms 10 ms ae-11.r25.tokyjp05.jp.bb.gin.ntt.net [61.213.162.173]
9 109 ms 11 ms 16 ms ae-11.r30.tokyjp05.jp.bb.gin.ntt.net [129.250.6.51]
10 104 ms 118 ms 103 ms ix-pa9.int-gw.kddi.ne.jp [111.87.3.74]