Skip to content

Instantly share code, notes, and snippets.

View akexorcist's full-sized avatar
🔥

Akexorcist akexorcist

🔥
View GitHub Profile
@akexorcist
akexorcist / DesignQuiz.xml
Created October 7, 2016 20:37
เฉลยโจทย์การออกแบบหน้าตาแอปพลิเคชัน
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7F7F7"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
@akexorcist
akexorcist / NewCode.java
Last active November 3, 2016 22:33
BluetoothSPP HotFix
// BluetoothService.java
// Line 358
while(mmInStream.available() > 0) {
int data = mmInStream.read();
arr_byte.add(data);
if(mmInStream.available() == 0) {
buffer = new byte[arr_byte.size()];
for (int i = 0; i < arr_byte.size(); i++) {
buffer[i] = arr_byte.get(i).byteValue();
ตอน 1 http://alive.in.th/watch_video.php?v=51155B8NGUMB
ตอน 2 http://alive.in.th/watch_video.php?v=9371BYOMD3X6
ตอน 3 http://alive.in.th/watch_video.php?v=89YWN696KXGB
ตอน 4 http://alive.in.th/watch_video.php?v=KO376K6BOMMW
ตอน 5 http://alive.in.th/watch_video.php?v=1Y6NUNOS651D
ตอน 6 http://alive.in.th/watch_video.php?v=H9YWU83G6293
ตอน 7 http://alive.in.th/watch_video.php?v=UKD3UN26K3HU
ตอน 8 http://alive.in.th/watch_video.php?v=HX9MYXKG5W9Y
ตอน 9 http://alive.in.th/watch_video.php?v=4OBOXYDG5UNS
ตอน 10 http://alive.in.th/watch_video.php?v=6M6RNDHAMAMR
@akexorcist
akexorcist / AnyWhere.java
Created April 2, 2017 20:30
Singleton Sound Player in Android
SoundPoolManager.getInstance().play(getContext(), R.raw.any_sound);
MediaPlayerManager.getInstance().play(getContext(), R.raw.any_sound);
@akexorcist
akexorcist / get_beer_list.json
Last active April 14, 2017 09:18
Example JSON for NongBeer app
// Successful
{
"status": "SUCCESS",
"message": "Retrieve the list of beer successfully.",
"nextBeerAvailable": true,
"nextBeerIndex": 1,
"beers": [
{
"id": "0102023",
"name": "Hoegaarden",
@akexorcist
akexorcist / order.txt
Last active May 7, 2017 14:23
สั่งของจาก GitHub
3" Octocat Figurine
จำนวน 1 ตัว
https://github.myshopify.com/products/octocat-figurine
GitHub Username Shirt
Linear/Men's Medium-Indigo
จำนวน 1 ชุด
https://github.myshopify.com/products/github-username-shirt
@akexorcist
akexorcist / DeviceSchema.js
Last active September 28, 2017 02:05
NBTC Auto Fetch
const mongoose = require('mongoose');
var deviceSchema = mongoose.Schema({
j_id: String,
j_cert_no: String,
j_trade_name: String,
j_model_code: String
})
module.exports.DeviceModel = mongoose.model('DeviceModel', deviceSchema, 'device_list')
@akexorcist
akexorcist / BaseItem.kt
Last active November 1, 2017 03:20
Simple parcelable model class
open class BaseItem(open var type: Int) : Parcelable {
constructor(parcel: Parcel) : this(
type = parcel.readInt())
override fun writeToParcel(parcel: Parcel, flags: Int) {
with(parcel) {
writeInt(type)
}
}
@akexorcist
akexorcist / index.js
Created January 3, 2018 16:27
Request body for Axios in NodeJS web service article
const requestBody = {
name: 'Akexorcist',
age: '28',
position: 'Android Developer',
description: 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/',
awesome: true
}
@akexorcist
akexorcist / index.js
Last active September 13, 2024 19:03
Axios post method requesting with x-www-form-urlencoded content type. See https://axios-http.com/docs/urlencoded
const axios = require('axios')
/* ... */
const params = new URLSearchParams()
params.append('name', 'Akexorcist')
params.append('age', '28')
params.append('position', 'Android Developer')
params.append('description', 'birthdate=25-12-1989&favourite=coding%20coding%20and%20coding&company=Nextzy%20Technologies&website=http://www.akexorcist.com/')
params.append('awesome', true)