Skip to content

Instantly share code, notes, and snippets.

View ripzery's full-sized avatar
🎯
Focusing

PS ripzery

🎯
Focusing
  • Thailand
View GitHub Profile

UTXOs

Given that:

  • ETH is a token user wants to send
  • OMG is a fee token
ETH OMG
5 5
10 10
@ripzery
ripzery / counter_service.ex
Last active April 29, 2020 16:34
Counter Example to demonstrate GenServer from Programming Phoenix 1.4
defmodule CounterService do
use GenServer
def inc(pid), do: GenServer.cast(pid, :inc)
def dec(pid), do: GenServer.cast(pid, :dec)
def val(pid) do
GenServer.call(pid, :val)
end
def start_link(initial_val) do
@ripzery
ripzery / keybase.md
Last active September 11, 2019 05:53
Keybase identity

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@ripzery
ripzery / options-ssl-nginx.conf
Created August 23, 2019 17:02
These files are need for initialise the Letsencrypt ssl certificate
ssl_session_cache shared:le_nginx_SSL:1m;
ssl_session_timeout 1d;
ssl_session_tickets off;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_stapling on;
ssl_stapling_verify on;
@ripzery
ripzery / setting.json
Created July 29, 2019 01:18
VSCode setting.json
{
// Editor
"editor.fontFamily": "Iosevka",
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.wordBasedSuggestions": false,
"editor.minimap.enabled": false,
"editor.renderControlCharacters": false,
@ripzery
ripzery / autosizing_textview.xml
Last active March 23, 2017 09:34
Granularity Autosizing TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoSizeMinTextSize="12sp"
android:autoSizeMaxTextSize="100sp"
android:autoSizeStepGranularity="2sp" />
@ripzery
ripzery / fonts.xml
Created March 23, 2017 09:19
A sample file for custom font in XML (Android O)
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/lobster_regular" />
<font
android:fontStyle="italic"
android:fontWeight="400"
android:font="@font/lobster_italic" />
@ripzery
ripzery / log_gcm_structure
Last active October 18, 2016 23:53
gcm structure from tsl which uses notification payload
10-18 23:58:21.170 25945-26010/com.socket9.thetsl D/MyGRcmListenerService: From: 197311876504
10-18 23:58:21.172 25945-26010/com.socket9.thetsl I/MyGcmListenerService: Bundle[{google.sent_time=1476809900797, type=SERVICE BOOKING, google.message_id=0:1476809900806468%43ae439143ae4391, notification=Bundle[{body=รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริการที่ TSL Auto Service ในวันที่ 21/09/2016 เวลา 15:19:00 น., title=SERVICE BOOKING}], message={"th_data":{"date":"Wednesday, September 21, 2016","time":"3:19 pm","type":"บริการแบบ A","branch":"ศูนย์บริการภูเก็ต"},"th":"รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริการที่ TSL Auto Service ในวันที่ 21\/09\/2016 เวลา 15:19:00 น.","en_data":{"date":"Wednesday, September 21, 2016","time":"3:19 pm","type":"Service A","branch":"Phuket Service Center"},"en":"Date confirm 21\/09\/2016 Time 15:19:00"}, collapse_key=com.socket9.thetsl}]
10-18 23:58:21.173 25945-26010/com.socket9.thetsl I/MyGcmListenerService: รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริกา
@ripzery
ripzery / build.gradle (App's level)
Last active July 6, 2016 05:28
Reference for gradle-play-publisher configuration
apply plugin: 'com.android.application'
apply plugin: 'com.github.triplet.play'
android {
signingConfigs {
release {
keyAlias 'keystore'
keyPassword 'password'
storeFile file('../keystore.jks')
storePassword 'password'
@ripzery
ripzery / build.gradle (Project's level)
Last active July 6, 2016 05:22
Reference for config gradle-play-publisher
buildscript {
ext.kotlin_version = '1.0.3'
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.github.triplet.gradle:play-publisher:1.1.4'
}
}