Skip to content

Instantly share code, notes, and snippets.

View teerasej's full-sized avatar
🎯
Teaching about cross platform mobile app development and A.I

Teerasej Jiraphatchandej teerasej

🎯
Teaching about cross platform mobile app development and A.I
View GitHub Profile
@teerasej
teerasej / index.php
Last active September 25, 2016 15:03
Enable CorsSlim in Slim Framework 3 Web API
$corsOptions = array(
"origin" => "*",
"exposeHeaders" => array("Content-Type", "X-Requested-With", "X-authentication", "X-client"),
"allowMethods" => array('GET', 'POST', 'PUT', 'DELETE', 'OPTIONS')
);
$cors = new \CorsSlim\CorsSlim($corsOptions);
$app->add($cors);
@teerasej
teerasej / app.js
Created June 15, 2016 02:29
Sample array with objects
$scope.profiles = [{
id: '1',
firstname: 'ณเดชน์',
lastname: 'คูกิมิยะ',
nickname: 'ณเดชน์'
}, {
id: '2',
firstname: 'เจษฎาภรณ์',
lastname: 'ผลดี',
nickname: 'ติ๊ก'
// Defined to be used in Slim Web API
// MAMP
$config['db']['user'] = "root";
$config['db']['pass'] = "root";
// XAMPP
$config['db']['user'] = "root";
$config['db']['pass'] = "";
@teerasej
teerasej / config.xml
Created July 2, 2016 08:20
[Ionic] Allow phone app call in Android
<access origin="tel:*"/>
<allow-intent href="tel:*" />
@teerasej
teerasej / GitHub.md
Last active November 7, 2021 14:50
วิธีตั้งโปรเจค git เข้า Remote H

วิธีตั้งโปรเจค git เข้า Remote Host

วิธีตั้งค่า Proxy ให้ Git

เราสามารถตั้งค่า Proxy ให้ Git ได้ด้วยคำสั่งนี้ ผ่าน Command Line

	git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

เปลี่ยนข้อมูลในคำสั่งตามรายละเอียดด้านล่าง

@teerasej
teerasej / gitignore_for_Xamarin.md
Last active September 8, 2016 15:41
gitignore file for Xamarin Project

How to create gitignore in Windows and Mac (Xamarin Edition)

  1. Create gitignore.txt in root of Xamarin Solution
  2. Copy below command to gitignore.txt
  3. Open Xamarin's solution folder:
  • Windows: Hold SHIFT key, right-click on Xamarin Solution's Folder, then choose 'Open Command Window Here'
  • Mac: Drag Xamarin's solution folder, drop on Terminal app icon
  1. Run rename command:
  • Windows: ren gitignore.txt .gitignore
  • Mac: mv gitignore.txt .gitignore
@teerasej
teerasej / ADBDriver_Setup_Thai.md
Created August 28, 2016 15:11
วิธีติดตั้ง USB Driver สำหรับคนขี้เกียจหา Driver
@teerasej
teerasej / xamarin_ios_camera_key.md
Created November 1, 2016 07:59
Key ที่ต้องเพิ่มลงใน Info.plist ของ Xamarin.iOS สำหรับใช้เปิดใช้งานกล้องถ่ายรูป

Key ที่ต้องเพิ่มลงใน Info.plist ของ Xamarin.iOS สำหรับใช้เปิดใช้งานกล้องถ่ายรูป

  • NSCameraUsageDescription ซึ่งจะแสดงข้อความตอนที่แอพเราจะขอเปิดใช้งานกล้องครั้งแรก
  • NSPhotoLibraryUsageDescription ซึ่งจะแสดงข้อความตอนที่แอพเราพยายามเซฟรูปลง Photo Library หรืออัลบั้มเป็นครั้งแรก
@teerasej
teerasej / express_to_heroku.md
Last active November 25, 2016 09:26
Step by Step to practice deploy express server to heroic
npm install @ionic-native/core --save
"dependencies": {
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",