Skip to content

Instantly share code, notes, and snippets.

Eric Li ericksli

Block or report user

Report or block ericksli

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
ericksli /
Last active Jan 11, 2020
Move PNG files for Android and iOS project


Move PNG files for Android and iOS project.

Suppose you have these images exported from Avocode in ~/Downloads/test:

├── image_distance-hdpi.png
├── image_distance-mdpi.png
ericksli /
Created Jul 26, 2019
Android ADB enable/disable animation

Disable animation

adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0

Enable animation

ericksli /
Last active Jun 11, 2019
Android default date and time formats

Android Default Date and Time Formats

Sample Timestamps

Name Timestamp (millisecond) Human-readable form
Timestamp A 1557086889000 Monday, 6 May 2019 04:08:09 GMT+08:00
Timestamp B 1571984435000 Friday, 25 October 2019 14:20:35 GMT+08:00

12-hour Format

ericksli / Mail merge.csv
Last active Apr 13, 2019
Google Apps Script mail merge
View Mail merge.csv
Email Name Prize Sent By Sent At Atlas Cantu Google Pixel 3 Keir James Huawei Mate 20 Pro Rhianne Kendall Samsung Galaxy Note 9 Lillie-Rose Hahn Sony Xperia XZ3 Leyton Zamora LG G7 ThinQ
ericksli / latecert.js
Created Feb 10, 2019
Fill in the MTR late cert form usling puppeteer.
View latecert.js
const puppeteer = require('puppeteer');
const readline = require('readline');
const sleep = require('util').promisify(setTimeout);
const EVENT_SELECTOR = 'select#ddlEvent';
const NAME_SELECTOR = 'input#username';
const EMAIL_SELECTOR = 'input#email';
const CAPTCHA_SELECTOR = 'input#captcha-form';
ericksli / Calendar Template.html
Created Oct 17, 2018
Google Apps Script create calendar events
View Calendar Template.html
<b>英文名:</b> <?= enTitle ?>
<br><b>中文名:</b> <?= zhTitle ?>
ericksli / DemoActivity.kt
Last active Sep 3, 2018
Simplify the creation of ViewModel #android #kotlin
View DemoActivity.kt
class DemoActivity : AppCompatActivity() {
private lateinit var viewModel: MyViewModel
override fun onCreate(savedInstanceState: Bundle?) {
viewModel = viewModel(MyViewModel.Factory(application))
ericksli / ReactNativeExtensions.kt
Last active Aug 29, 2019
React Native Kotlin extension functions for creating WritableMap and WritableArray #android #react-native #kotlin
View ReactNativeExtensions.kt
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableArray
import com.facebook.react.bridge.WritableMap
fun writableMapOf(vararg values: Pair<String, *>): WritableMap {
val map = Arguments.createMap()
for ((key, value) in values) {
when (value) {
null -> map.putNull(key)
is Boolean -> map.putBoolean(key, value)
ericksli / DividerItemDecoration.kt
Last active Sep 3, 2018
Draw bottom divider in RecyclerView with customisable show/hide divider and paddings for each item #android
View DividerItemDecoration.kt
import android.content.Context
import org.jetbrains.anko.dip
ericksli / lr-station-platform.json
Last active Sep 2, 2017
Hong Kong MTR Light Rail stations and platforms
View lr-station-platform.json
"code": "001",
"initial": "FEP",
"titleZh": "屯門碼頭",
"titleEn": "Tuen Mun Ferry Pier",
"latitude": 22.37284525,
"longitude": 113.9661371,
"fareZone": "1",
"platforms": [
You can’t perform that action at this time.