Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar
😊

Anuchit Chalothorn anoochit

😊
View GitHub Profile
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
// กรอก Wi-Fi
const char* ssid = "YOUR_WIFI_SSID";
const char* password = "********";
// พิกัดประเทศไทยโดยประมาณ
const float TH_LAT = 15.0;
const float TH_LON = 101.0;
const float MAX_DISTANCE_KM = 1000.0; // รัศมี 1000 กม.
@anoochit
anoochit / copilot-instructions.md
Created April 14, 2025 11:53 — forked from jukbot/copilot-instructions.md
Copilot instruction, Cursor rules for Go lang 1.24

Go API Development Assistant Prompt (Go 1.24+)

You are an expert AI programming assistant specializing in building APIs with Go, using the standard library's net/http package and the latest features introduced in Go 1.24.

Always use the latest stable version of Go (1.24 or newer) and be deeply familiar with RESTful API design principles, Go idioms, and the evolving capabilities of the standard library.


✅ Responsibilities

@anoochit
anoochit / install_appwrite.md
Created February 12, 2025 06:07
Install Appwrite using Docker with custom domain

To install Appwrite using Docker with a custom domain, follow these steps:


1. Install Docker & Docker Compose

Ensure that Docker and Docker Compose are installed on your server.

sudo apt update && sudo apt install -y docker.io docker-compose
@anoochit
anoochit / chatgpt_api_call.md
Created January 23, 2025 10:24
Chat GPT API in PHP

You can convert your curl command into a PHP script using the curl functions in PHP. Here's an example of how to do it:

<?php

$apiKey = 'YOUR_OPENAI_API_KEY'; // Replace with your actual OpenAI API key

$data = [
    "model" => "gpt-4o",
    "messages" => [
@anoochit
anoochit / load_epub_asset.dart
Created July 27, 2024 18:55
Load epub data from assets
Future<EpubController> loadEpub() async {
var asset = await PlatformAssetBundle().load("assets/alice.epub");
return EpubController(
document: EpubDocument.openData(asset.buffer
.asUint8List(asset.offsetInBytes, asset.lengthInBytes)));
}
@override
Widget build(BuildContext context) => FutureBuilder<EpubController>(
future: loadEpub(),
@anoochit
anoochit / main.dart
Created March 27, 2024 08:24
consult radio button
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@anoochit
anoochit / main.dart
Created March 9, 2024 12:36
alert dialog
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@anoochit
anoochit / main.dart
Created February 13, 2024 07:17
sample color scheme seed
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@anoochit
anoochit / shimmer.dart
Created January 30, 2024 11:13
simmer effect with gidview
GridView.builder(
itemCount: 8,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 4,
crossAxisSpacing: 4,
),
itemBuilder: (context, index) {
return Shimmer.fromColors(
baseColor: Colors.grey.shade200,
@anoochit
anoochit / th-address.json
Created November 20, 2023 11:31 — forked from mennwebs/th-address.json
Thai Address from Postal Code - JSON
This file has been truncated, but you can view the full file.
[
{
"zipCode": "10100",
"subDistrictList": [
{
"subDistrictId": "100801",
"districtId": "1008",
"provinceId": "10",
"subDistrictName": "ป้อมปราบ"