Skip to content

Instantly share code, notes, and snippets.

View mitchwongho's full-sized avatar
:atom:
Build > Test > Deploy

Mitchell Wong Ho mitchwongho

:atom:
Build > Test > Deploy
View GitHub Profile
@mitchwongho
mitchwongho / android-generate-keystores.md
Created May 17, 2021 10:37 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@mitchwongho
mitchwongho / brew-ruby.txt
Created May 13, 2021 09:40
Brew Caveat: Ruby
==> ruby@2.7
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/2.7.0/bin
You may want to add this to your PATH.
ruby@2.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have ruby@2.7 first in your PATH, run:
@mitchwongho
mitchwongho / dynamodb.java
Created May 8, 2021 09:48
#DynamoDB #JavaSDK #AWS
private Result getPeopleByGSI(@NotNull final String indexedReference, final String... attributes) {
// make reference the index
final DynamoDbIndex<People> index = DynamoUtil.peopleTable.index("someIndexedAttribute-index");
// Apply value to the indexed attribute (as the PartitionKey)
final QueryConditional queryConditional = QueryConditional.keyEqualTo(
Key.builder().partitionValue(indexedReference).build());
// Compose Filter expressions
final List<String> expressions = new ArrayList<>();
final Expression.Builder expressionBuilder = Expression.builder();
@mitchwongho
mitchwongho / git-pull.txt
Last active May 7, 2021 08:58
CodeCommit - Git Checkout - Detached HEAD
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
G28 ; Home all axes
G29 ; Auto bed-level (BL-Touch)
;G1 Z15.0 F6000 ;Move the platform down 15mm
;Prime the extruder
G92 E0
G1 F200 E3
G92 E0
; Linear advance
M900 K0.11
@mitchwongho
mitchwongho / raspberry_pi_openvpn_tips.md
Created July 13, 2019 20:33
Raspberry Pi OpenVPN Tips

OpenVPN host config files:

$ cd /etc/openvpn

OpenVPN config file:

$ sudo nano /etc/default/openvpn
@mitchwongho
mitchwongho / HelloWorld.kt
Last active November 6, 2023 15:03
A trivial Gradle build file for a Kotlin application
fun main(args: Array<String>) {
MyFirstClass("Hello, My First Class").out()
}
class MyFirstClass(val message: String) {
fun out() {
println(message)
}
}
@mitchwongho
mitchwongho / android-basic.js
Last active April 17, 2018 10:56
Appium Android Basic session script
const wdio = require('webdriverio');
// Driver options
const opts = {
port: 4723,
desiredCapabilities: {
platformName: "Android",
platformVersion: "8.0",
deviceName: "Nexus 5X API 26",
app: "ApiDemos-debug.apk",
appPackage: "io.appium.android.apis",
@mitchwongho
mitchwongho / installation.md
Last active April 16, 2018 09:03
Getting Up and Running with Appium
$ brew install node      # get node.js
$ npm install -g appium  # get appium server
$ npm install webdriverio     # get the appium WebDriver client
@mitchwongho
mitchwongho / btcd.conf
Created January 25, 2018 06:38
Lightning & btcd setup
...
; Secure the RPC API by specifying the username and password. You can also
; specify a limited username and password. You must specify at least one
; full set of credentials - limited or admin - or the RPC server will
; be disabled.
rpcuser=w1/AxcoqWFqsey/x7C9drhaaWl8=
rpcpass=zGnTDRT4a7Pzn9j31n6D0c3S0vs=