Skip to content

Instantly share code, notes, and snippets.

View phamquyhai's full-sized avatar
🎯
Focusing

Pham Quy Hai phamquyhai

🎯
Focusing
View GitHub Profile
@phamquyhai
phamquyhai / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@phamquyhai
phamquyhai / returnok.json
Last active August 29, 2015 14:13
when successful
{
"success" : true,
"data":{
}
}
@phamquyhai
phamquyhai / Retrofit-trust-ssl.java
Last active December 5, 2016 02:23
Retrofit Trusting SSL with Certificate Pinner
# How to create Pin ?
# Using OpenSSL
# Example with api github
# Open terminal
# openssl s_client -connect api.github.com:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
# Get a key
CertificatePinner certificatePinner = new CertificatePinner.Builder()
package asia.fivejuly.chatwork;
import android.accessibilityservice.AccessibilityService;
import android.os.Bundle;
import android.support.v4.view.accessibility.AccessibilityEventCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import android.support.v4.view.accessibility.AccessibilityRecordCompat;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@phamquyhai
phamquyhai / config.js
Last active April 27, 2017 05:34
FDeploy Database
{
filename : "${project.name}-${version.detail.versionName}-${version.createdAt}.apk",
filelocation : "${project._id}/${version._id}.apk"
icon : "${project._id}/icon.png"
}
[
{
"purchase" : {
"autoRenewing" : true,
"orderId" : "asdfdg345353463rft345435", // hash unique
"packageName" : "com.example.abc",
"productId" : "book.abc.sub6month",
"purchaseTime" : 78354763544, //The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).
"purchaseState" : 0, //The purchase state of the order. Possible values are 0 (purchased), 1 (canceled), or 2 (refunded).
"developerPayload" : "34rsfdt3344asdsd...", // Auto create in Android Client

How to install OpenSTF in Ubuntu 14.04

  1. Add Add RethinkDB key

     source /etc/lsb-release && echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
     wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
    
  2. Install packages

sudo apt-get update && sudo apt-get install -y git nodejs nodejs-legacy npm rethinkdb android-tools-adb python autoconf automake libtool build-essential ninja-build libzmq3-dev libprotobuf-dev git graphicsmagick yasm stow

@phamquyhai
phamquyhai / haipq.pub
Created September 25, 2017 02:03
Public Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDoVXV2iS74Dy+QgE+2qM1/bF59ISs494BdviCGyz+uvSQ944G0Aw+wspeHnfz+7sfxbnImoZVxB5NL/NIOGItnqRjmmIJ+MpykCX1H7QczukLoBLWlJzeyo+GYnjSZxN4AEJT91oMgL/WB4PMIRGF6o6xKZLAyMqaOSQB9/uh638K+obfakQSw5g7xhcfuSdQ/PhYZttPFaPDB9FmMlHYKEqSk1jvF1D7zIBbKtmrIxBB2+wao4qOShDo7XwzYozbGjqYvaQ6SM1ypNNVQzYUJeTUWmJj562xoBsLvsmtBWq8sJhF/UfUwh5RTng42NvAvEnek+9/GZ1PLtZJTTaiz pham.quy.hai@framgia.com
@phamquyhai
phamquyhai / cloudSettings
Last active October 11, 2018 14:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-05-25T03:20:10.584Z","extensionVersion":"v2.9.2"}
@phamquyhai
phamquyhai / clean_cache.sh
Last active December 10, 2018 07:03
React Native Yarn Clean cache
watchman watch-del-all && \
rm -rf node_modules && \
rm -rf /tmp/metro-bundler-cache-* && \
rm -rf /tmp/haste-map-react-native-packager-* && \
yarn && yarn start --reset-cache