Skip to content

Instantly share code, notes, and snippets.

Tuan Chau tuanchauict

  • LINE
  • Vietnam
Block or report user

Report or block tuanchauict

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
def testcase(*testcases):
def build_format():
max_param_len = 0
max_result_len = 0
num_params = 0
for case in testcases:
num_params = len(case) - 1
for param in case[1:]:
str_param = str(param)
max_param_len = max(max_param_len, len(str_param))
View just-read-dark-and-big-theme.css
@import url('|Inconsolata|Lora|Slabo+27px|Song+Myung|Source+Serif+Pro|Roboto Mono');
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
body {
font-family: 'Source Serif Pro', Lora, 'Slabo 27px', 'Goudy Bookletter 1911', serif;
line-height: 1.4em;
def solution(A, B):
go_up_count = 0
s1 = []
for i in range(0, len(A)):
a = A[i]
b = B[i]
if b == 0:
if not s1:
go_up_count += 1
tuanchauict / script.js
Last active Mar 25, 2018
Make safaribooks great again
View script.js
setTimeout(function() {
setInterval(function() {
}, 1000);
}, 2000);
View shareconfig.gradle
android {
multiDexEnabled true
android.applicationVariants.all { variant ->
println "*********" + variant.description + "********** ";
def variants = variant.baseName.split("-");
def apkName = "mangarock-";
apkName += variants[0];
tuanchauict /
Last active Mar 24, 2017
JConst: Automatically make constants

What is this?

Inspirated by Golang's const, I made this script for automation set value for constants white writing Java code.


int A;
int B;
tuanchauict /
Last active Dec 15, 2016
Build, install and run release build

Grab code then

apply from: 'lazy.gradle'
tuanchauict / IDETextKeyBindingSet.plist
Last active Nov 9, 2016
XCode IDEA-like macro. Make XCode less suck
View IDETextKeyBindingSet.plist
<key>Duplicate Lines</key>
<string>selectLine:, copy:, moveToEndOfLine:, paste:, deleteBackward:</string>
<key>Duplicate Current Line</key>
<string>moveToBeginningOfLine:, deleteToEndOfLine:, yank:, insertNewline:, moveToBeginningOfLine:, yank:</string>
<key>Start New Line</key>
<string>moveToEndOfLine:, insertNewline:</string>
<key>Start New Line Above</key>
<string>moveUp:, moveToEndOfLine:, insertNewline:</string>
tuanchauict / build.gradle
Last active Jul 11, 2018
Auto switch signing configs for multiple-releases-product
View build.gradle
apply from: 'release.gradle'
productFlavors {
dev {
tuanchauict / build.gradle
Last active Oct 14, 2016
Auto increment version code and version name. This gist borrows heavily the code from
View build.gradle
//module gradle
apply from: 'versionCode.gradle' //anywhere
android {
defaultConfig {
versionName VERSION_NAME
versionCode Integer.parseInt(VERSION_CODE)
You can’t perform that action at this time.