Skip to content

Instantly share code, notes, and snippets.

View tuanchauict's full-sized avatar
🐟
I am lazy

Tuan Chau tuanchauict

🐟
I am lazy
View GitHub Profile
@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;
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 December 2, 2020 22:07
Make safaribooks great again
setTimeout(function() {
document.getElementsByClassName("sbo-toc-thumb")[0].click();
setInterval(function() {
document.getElementsByClassName("sbo-toc-thumb")[0].click();
}, 1000);
}, 2000);
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 March 24, 2017 23:49
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.

Just:

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

Grab code then

apply from: 'lazy.gradle'

@tuanchauict
tuanchauict / IDETextKeyBindingSet.plist
Last active November 9, 2016 03:37
XCode IDEA-like macro. Make XCode less suck
<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 November 29, 2022 10:07
Auto switch signing configs for multiple-releases-product
apply from: 'release.gradle'
android{
productFlavors {
dev {
//...
}
//...
}
@tuanchauict
tuanchauict / build.gradle
Last active October 14, 2016 04:07
Auto increment version code and version name. This gist borrows heavily the code from https://gist.github.com/luciofm/923a9f35f2175dda7ad7.
//module gradle
apply from: 'versionCode.gradle' //anywhere
android {
defaultConfig {
versionName VERSION_NAME
versionCode Integer.parseInt(VERSION_CODE)
}
}
import scrapy
from crawler.items import CommentItem
from crawler.items import PostItem
class TinhteSpider(scrapy.Spider):
name = "tinhte"
allowed_domains = ["tinhte.vn"]
start_urls = [