Skip to content

Instantly share code, notes, and snippets.

View winstonleedev's full-sized avatar
🎯
Focusing

Winston Lee winstonleedev

🎯
Focusing
View GitHub Profile
@winstonleedev
winstonleedev / Colors.kt
Created September 7, 2020 21:38
Kotlin androidx (jetpack) material design color definitions
package kr.hanquoc.ciderhead.ui.definitions
import androidx.compose.ui.graphics.Color
object Colors {
val red50 = Color(0xFFFFEBEE)
val red100 = Color(0xFFFFCDD2)
val red200 = Color(0xFFEF9A9A)
val red300 = Color(0xFFE57373)
val red400 = Color(0xFFEF5350)
@winstonleedev
winstonleedev / leveldb-benchmark.sh
Last active July 17, 2020 00:19
Benchmark to extract keys and value from level db, and read them again from the new database
#!/bin/bash
# Create smaller DB from big DB
sudo lev ~/caliper-scripts/generated/production/ledgersData/chains/index --all --limit 1000000 > ~/benchdb.export
sudo lev ~/benchdb --batch ~/benchdb.export
# Bench querying the big DB
{ time { sudo lev ~/caliper-scripts/generated/production/ledgersData/chains/index --keys > /dev/null; } } 2> ~/bigQuery.txt
# Bench querying the small DB
@winstonleedev
winstonleedev / caliper-server-setup.sh
Last active January 16, 2020 03:15
Script to setup Hyperledger and Caliper on a clean Ubuntu 18.04 install.
# one liner
# wget https://gist.githubusercontent.com/thanhphu/feb433495bc57c903fca55c53ceb01c1/raw/1e51b96ebd9baa4ead5fbc5b1e2e02df7c9617f4/caliper-server-setup.sh -O - | sh
git clone https://thanhphu-medium@bitbucket.org/mediumblockchain/m3-caliper.git
cd m3-caliper
./init.sh
@winstonleedev
winstonleedev / unikey.xml
Last active October 24, 2019 01:57
How to enable dvorak layout for ibus-unikey. Put this file in /usr/share/ibus/component
<?xml version="1.0" encoding="utf-8"?>
<!-- filename: unikey.xml -->
<component>
<name>org.freedesktop.IBus.Unikey</name>
<description>Unikey Component</description>
<exec>/usr/lib/ibus/ibus-engine-unikey --ibus</exec>
<version>0.6.1</version>
<author>Lê Quốc Tuấn &lt;mr.lequoctuan@gmail.com&gt;</author>
<license>GPL</license>
<homepage>http://code.google.com/p/ibus-unikey</homepage>
@winstonleedev
winstonleedev / 45-allow.colord.pkla
Created June 17, 2019 05:21
Configuration changes needed to use xrdp on ubuntu
;/etc/polkit-1/localauthority/50-local.d/45-allow.colord.pkla
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
@winstonleedev
winstonleedev / dvorak.ahk
Last active April 22, 2023 06:02
Dvorak-QWERTY with Korean support, pause when Korean IME is detected or Scroll lock is on. Support CTRL + SHIFT and ALT+SHIFT. To use enable Dvorak layout and run this script
;Dvorak with Korean support, pause when Korean IME is detected or Scroll lock is on
Loop {
If GetKeyState("ScrollLock", "T")
or (DllCall("GetKeyboardLayout", Int,DllCall("GetWindowThreadProcessId", int,WinActive("A"), Int,0)) == 68289554) {
Suspend On
} else {
Suspend Off
}
Sleep, 50
@winstonleedev
winstonleedev / gist:a9fa11c0d6964baba4ae4f568f7661e7
Last active September 26, 2019 01:11
Blockstack verification
Verifying my Blockstack ID is secured with the address 14KDJk2Y3rVPJ1fAfnpUyo4FsPmyKwrnkz https://explorer.blockstack.org/address/14KDJk2Y3rVPJ1fAfnpUyo4FsPmyKwrnkz
@winstonleedev
winstonleedev / keybase.md
Last active September 26, 2019 01:12
Keybase verification

Keybase proof

I hereby claim:

  • I am thanhphu on github.
  • I am thanhphu (https://keybase.io/thanhphu) on keybase.
  • I have a public key ASDFXeWrFHMV7yZ3O0Yk8eBOTGkuPH7DmXqylIpP89XjYAo

To claim this, I am signing this object: