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
View test-leet-code.py
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('https://fonts.googleapis.com/css?family=Goudy+Bookletter+1911|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;
View Codility.Fish.py
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
else:
@tuanchauict
tuanchauict / script.js
Last active Mar 25, 2018
Make safaribooks great again
View script.js
setTimeout(function() {
document.getElementsByClassName("sbo-toc-thumb")[0].click();
setInterval(function() {
document.getElementsByClassName("sbo-toc-thumb")[0].click();
}, 1000);
}, 2000);
View shareconfig.gradle
android {
defaultConfig{
multiDexEnabled true
}
android.applicationVariants.all { variant ->
println "*********" + variant.description + "********** ";
def variants = variant.baseName.split("-");
def apkName = "mangarock-";
apkName += variants[0];
@tuanchauict
tuanchauict / README.md
Last active Mar 24, 2017
JConst: Automatically make constants
View README.md

What is this?

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

Just:

//#constant(
int A;
int B;
@tuanchauict
tuanchauict / README.md
Last active Dec 15, 2016
Build, install and run release build
View README.md

Grab code then

apply from: 'lazy.gradle'
@tuanchauict
tuanchauict / IDETextKeyBindingSet.plist
Last active Nov 9, 2016
XCode IDEA-like macro. Make XCode less suck
View IDETextKeyBindingSet.plist
<key>Customized</key>
<dict>
<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
tuanchauict / build.gradle
Last active Jul 11, 2018
Auto switch signing configs for multiple-releases-product
View build.gradle
apply from: 'release.gradle'
android{
productFlavors {
dev {
//...
}
//...
}
@tuanchauict
tuanchauict / build.gradle
Last active Oct 14, 2016
Auto increment version code and version name. This gist borrows heavily the code from https://gist.github.com/luciofm/923a9f35f2175dda7ad7.
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.