Skip to content

Instantly share code, notes, and snippets.

View Tanapruk's full-sized avatar
🎯
Focusing

Tanapruk Tanapruk

🎯
Focusing
View GitHub Profile
@Tanapruk
Tanapruk / RunAScriptWithNode.md
Last active March 20, 2017 07:36
Selenium Web Driver

Run A Script

To run a simple script, for example, google_search.js

const {Builder, By, until} = require('selenium-webdriver');
new Builder()
    .forBrowser('firefox')
 .build()
@Tanapruk
Tanapruk / update.md
Last active March 16, 2017 03:21
Android's SDK Manager CLI

To update all installed sdk and agree at all license agreement

sdkmanager --update && yes | sdkmanager --licenses

Comments

  • sdkmanager --update launch sdkmanager and update all installed sdks.
  • yes | sdkmanager --licenses enter 'y' to each acceptance prompt.
  • yes is a binary preinstalled with Linux based PC. It will type 'y' to each prompt.
@Tanapruk
Tanapruk / git merge and rebase.png
Last active March 15, 2017 05:29
git merge and git rebase comparison
git merge and rebase.png
@Tanapruk
Tanapruk / emulator.md
Last active March 15, 2017 14:12
Android Emulator related CLI

Create emulator from command-line

avdmanager create avd 
--package "system-images;android-25;google_apis;x86" 
--name "Test" 
--tag "google_apis" 
--device 17
@Tanapruk
Tanapruk / note.md
Created March 9, 2017 05:55
Android Website
@Tanapruk
Tanapruk / angular-tour-of-heroes.md
Last active March 18, 2017 17:20
Angular2 Shortnotes

Variable Reference from inside HTML Tag. Double bracklets.

{{var}}

Two-way binding. "Banana in a box". All variables that refer to the hero.name will be updated , too.

[()]

[(ngModel)]="hero.name"

@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 / 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 / AndroidTestCode.md
Last active March 18, 2017 15:47
Implementing Appium for Android and iOS using java-client through Android Studio

Codes for Android

Android smallest UI unit is View. However, in Appium, the unit is called element instead. We find element instead of View. Before we take any action on the screen, we have to locate the element first.There are various way to findElement from your codes. But some of them don't work well, so I gather here what work as expected for me. Most of them rely on Ui Automation framework. After that, we take action by using built-in methods of element. For example, element.click() to click an element or element.getText() to get word from that element.

You should declare a field variable driver. As follows:

protected static AndroidDriver driver;
@Tanapruk
Tanapruk / 1FileInputStreamFileOutputStream.md
Last active November 25, 2020 11:09
Input and Output Stream of Java

Page 1

I/O

When using Input or Output with java programming. We have serveral ways of implementing them. At the smallest and lowest level possible is FileInputStream and FileOutputStream. As the names describe one is for input the other is for output.

  • Input - read files/read log
  • Output - write files/print to log

FileInputStream and FileOutputStream.