Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
¯\_ (ツ) _/¯

Chai Phonbopit Phonbopit

👻
¯\_ (ツ) _/¯
View GitHub Profile
@Phonbopit
Phonbopit / MainActivity.java
Created May 21, 2014
Android Button OnClick Tutorial
View MainActivity.java
package com.devahoy.android.sample.button;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends ActionBarActivity implements View.OnClickListener {
@Phonbopit
Phonbopit / AndroidManifest.xml
Last active Jan 26, 2021
Android Connecting HTTP With AsyncTask Example, Original Post : http://devahoy.com/posts/android-asynctask-tutorial/
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.phonbopit.sample" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@Phonbopit
Phonbopit / index.html
Created May 23, 2020
React 101 - EP. 1
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>React 101 By Devahoy</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
@Phonbopit
Phonbopit / app.js
Created Apr 11, 2020
ตัวอย่าง Code ตอนที่ 10 - Mongoose
View app.js
const express = require('express');
const mongoose = require('mongoose');
const options = {
useNewUrlParser: true,
useUnifiedTopology: true
};
mongoose.connect('mongodb://localhost:27017/hello-mongoose', options);
const CatModel = mongoose.model(
@Phonbopit
Phonbopit / LoopExample6.java
Last active Oct 12, 2019
โจทย์ตัวอย่าง Loop ใน Java รูปแบบต่างๆ @see http://devsharing.com/2012/java/java-loop-example2/
View LoopExample6.java
public class LoopExample6 {
public static void main(String[] args) {
for(int i=1; i<=5; i++){
for(int j=1; j<=(5-i); j++){
System.out.print(" ");
}
for(int k=1; k<i; k++){
System.out.print("* ");
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devahoy.sample.ahoygson" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
@Phonbopit
Phonbopit / LoginForm.js
Created Nov 3, 2018
components/LoginForm.js
View LoginForm.js
import React from 'react'
class LoginForm extends React.Component {
render() {
return (
<section className="section container">
<div className="columns is-centered">
<div className="column is-half">
<form>
<div className="field">
@Phonbopit
Phonbopit / ImageAdapter.java
Created Sep 3, 2013
Android - ImageAdapter for avoid out of memory.
View ImageAdapter.java
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;