Skip to content

Instantly share code, notes, and snippets.

View piruin's full-sized avatar
🎯
Focusing

Piruin Panichphol piruin

🎯
Focusing
View GitHub Profile
@piruin
piruin / place_by_id.json
Last active October 17, 2015 06:27
TanRaBan Restful Api GET RESPONSE
#api.tanraban.com/v1/place/c27364325ae0bfecc5f7e6f8c6de48a3
{
"place_id":"c2736432-5ae0-bfec-c5f7-e6f8c6de48a3",
"place_type_id":4,
"place_subtype_id":3,
"place_namt":"รพ.สต.บ้านบาละ",
"tambon":"950702",
"used":false,
"location":{
"type":"Point",
@piruin
piruin / domain-build.gradle
Last active October 18, 2015 02:07
build.gradle for android clean architect
apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
testCompile 'junit:junit:' + rootProject.ext.junitVersion
}
@piruin
piruin / post-building.json
Last active January 28, 2016 08:19
Tanrabad Api Post body sample
{
"building_id":"5cf5665b-5642-10fb-a3a0-5e612a842583",
"place_id":"5cf5665b-5642-10fb-a3a0-5e612a842584",
"place_type_id":4,
"name":"214/43",
"location":{
"type": "Point",
"coordinates": [73.150050, 39.745673]
},
"update_by":"dcp-user"
@piruin
piruin / AndroidManifest.xml
Created February 24, 2016 08:43
Web View Test
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webViewTest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name="MyActivity"
android:theme="@android:style/Theme.Holo.Light.Dialog"
@piruin
piruin / AndroidManifest.xml
Created February 24, 2016 09:20
Authen Demo
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.webViewTest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name=".LoginActivity"
android:theme="@android:style/Theme.Holo.Light.Dialog"
@piruin
piruin / system-or-localproperties.gradle
Last active April 12, 2016 07:10
Gradle get property from system variable or local.properties
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
sendbirdAppId = System.hasProperty("SENDBIRD_APP_ID") ? System.getenv('SENDBIRD_APP_ID') : properties.getProperty("sendbird.app-id")
sendbirdApiToken = System.hasProperty("SENDBIRD_API_TOKEN") ? System.getenv('SENDBIRD_API_TOKEN') : properties.getProperty("sendbird.api-token")
@piruin
piruin / ThaichoteMapTile.java
Last active June 8, 2016 15:45
Class provide map tiles from ThaiChote satellite's image to use with Google Maps API V2 for Android
/*
* Copyright (c) 2016 NECTEC
* National Electronics and Computer Technology Center, Thailand
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@piruin
piruin / ThaichoteMapTile.java
Last active June 8, 2016 16:11
Caching version of ThaichoteMapTile
/*
* Copyright (c) 2016 NECTEC
* National Electronics and Computer Technology Center, Thailand
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@piruin
piruin / start.bat
Created September 9, 2016 03:21
batch file to start multiple jar instance
@echo off
start "api-9001" java -Dfile.encoding=UTF8 -Dlog4j.configurationFile=log4j2.xml -jar faarmis-api-1.0.jar -port 9001
start "api-9002" java -Dfile.encoding=UTF8 -Dlog4j.configurationFile=log4j2.xml -jar faarmis-api-1.0.jar -port 9002
start "api-9003" java -Dfile.encoding=UTF8 -Dlog4j.configurationFile=log4j2.xml -jar faarmis-api-1.0.jar -port 9003
@piruin
piruin / nectec-apache-2.0
Created November 7, 2015 09:12
Intellij IDEA copyright profiles of NECTEC's Apache 2.0 License in Velocity templates
Copyright (c) $today.year NECTEC
National Electronics and Computer Technology Center, Thailand
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software