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
@tuanchauict
tuanchauict / README.md
Last active May 11, 2024 23:08
Attach a stopwatch to Leetcode

This script attaches a stopwatch into the toolbar of Leetcode's problem page.

image

The feature is simple:

  • Start/Stop the stopwatch
  • Auto start after 2 mins remaining on the problem
  • Restore unstopped stopwatch for the next visit on the problem

Use this script with any browser extension allowing attaching JS to the page. (I use User JavaScript and CSS)

@tuanchauict
tuanchauict / README.md
Last active March 31, 2022 03:08
Schedule today online meeting

Why

5-minute before an online meeting is the hard time because we need to separate our mind both for checking the clock and keeping working on what we are doing. This does not guaratee we won't miss 1, or 2, or sometimes 10 minutes.

This simple script is to help us early register online meeting, then it will open the link on time.

Usage

Let's assume that we set alias to the file as zoomin

alias zoomin="sh /path/to/zoomin.sh"
@tuanchauict
tuanchauict / PermissionActivity.java
Last active March 14, 2016 15:00
Headless permissions request for Android 23+
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.util.SparseArray;
import java.util.ArrayList;
@tuanchauict
tuanchauict / ParseListLoader.java
Last active October 23, 2015 01:35
ParseListLoader is an universal version of ParseQueryAdapter that we can use it on both ListView/GridView and RecyclerView as well as ViewPager
/*
* Copyright (C) 2015 Tuan Chau (tuanchauict)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@minhanhhere
minhanhhere / IpRange.java
Last active September 18, 2015 06:37
Goodbye Google
import java.util.Arrays;
import java.util.List;
public class IpRange {
//region BlackListIpRanges
public static final List<IpRange> blacklistIpRanges = Arrays.asList(
new IpRange("104.132.0.0 - 104.135.255.255"),
new IpRange("104.154.0.0 - 104.155.255.255"),
new IpRange("104.196.0.0 - 104.199.255.255"),
@tuanchauict
tuanchauict / SudokuBrain.go
Last active August 29, 2015 14:19
Sudoku solver algorithm by Golang, converted from Python language by http://norvig.com/sudoku.html
package sudoku
/**
* Algorithm from http://norvig.com/sudoku.html
*/
import (
"fmt"
"strings"
)