Skip to content

Instantly share code, notes, and snippets.

View Tanapruk's full-sized avatar
🎯
Focusing

Tanapruk Tanapruk

🎯
Focusing
View GitHub Profile
@Tanapruk
Tanapruk / kotlin02.md
Last active August 31, 2016 07:00
RxBinding

###Validate Your Login Email & Password With RxBinding and Kotlin

Variables

val emailChgObs = RxTextView.textChangeEvents(etEmail).publish().autoConnect(2)
val pwdChgObs = RxTextView.textChangeEvents(etPassword)

btnLogin.isEnabled = false

var subscriptionEmailValid = emailChgObs
@Tanapruk
Tanapruk / kotlin01.md
Last active September 7, 2016 06:07
Kotliner

###Extension Functions

####Kotlin

fun CharSequence.isEmail() = this.matches("[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+".toRegex())


val stringImpl : String = "foo@email.com"
@Tanapruk
Tanapruk / test01.md
Last active September 7, 2016 07:05
Test Framework verifyStatic
  1. dependencies
testCompile 'org.powermock:powermock-api-mockito:1.6.5'
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.6.5'
testCompile 'org.powermock:powermock-module-junit4-rule:1.6.5'
testCompile 'org.powermock:powermock-module-junit4:1.6.5'
  1. ใส่ tag บน class
@Tanapruk
Tanapruk / Proguard
Created October 23, 2016 09:32
Proguard guide
#I copy this from various places
#Debug when crashing by looking at:
#/app/build/outputs/mapping/normal/release
#mapping.txt use the class to search in here.
#
@Tanapruk
Tanapruk / bashscript
Created November 5, 2016 08:10
My Personal bash script as an Android Developer
#export path for android
export ANDROID_HOME=/Users/username/Documents/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tool
#to capture screen from android phone
function cap() {
LOCATIONPHONE=sdcard/screen_$(date "+%Y%m%d%H%M%S").png
@Tanapruk
Tanapruk / xvim for xcode 8.1.md
Last active November 27, 2016 06:26
installing xVim for xcode
@Tanapruk
Tanapruk / FingerPrintValidation.java
Last active January 19, 2017 10:41
Fingerprint scanner API
/**
*init service to check whether the phone use any security
*/
KeyguardManager keyguardManager = getSystemService(KeyguardManager.class);
/**
* if no keyguard then you cannot use fingerprint scanner.
*/
if (!keyguardManager.isKeyguardSecure()) {
// Show a message that the user hasn't set up a fingerprint or lock screen.
@Tanapruk
Tanapruk / BrowserSync.md
Created February 7, 2017 03:38
Automatically Reload Website on Save

This required Node

  • brew install node

Install Browser Sync

  • npm install -g browser-sync

Start Server

  • browser-sync start --server --files "**/*"
@Tanapruk
Tanapruk / EasiestStep.md
Last active February 14, 2017 04:41
Angular2 As Quick As possible

Installation

  • Brew

  • Install a Package Manager for Binary

  • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • Node

  • Install NodeJS binary. So that we can easily install node's library.

  • brew install node

  • Angular-cli

@Tanapruk
Tanapruk / note.md
Created March 9, 2017 05:55
Android Website