Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / Dockerfile
Last active March 31, 2024 22:43
Dockerfile for prisma dart and dart frog
FROM dart:latest as builder
# Install Node.js LTS to builder
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
apt-get install -y nodejs
# Sets the working directory to /app
WORKDIR /app
# Copies the current directory contents into the container at /app
@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 / pms7003.ino
Last active January 21, 2024 17:50
pms7003 with ESP32 hardware serial
#include "PMS.h"
HardwareSerial SerialPMS(1);
PMS pms(SerialPMS);
PMS::DATA data;
#define RXD2 23
#define TXD2 22
// ESP32 --> Pantower PMS7003
@anoochit
anoochit / esp8266-dht22-blynk.ino
Last active November 29, 2023 19:41
esp8266-dht22-blynk
/*
* This sketch demonstrates how to scan WiFi networks.
* The API is almost the same as with the WiFi Shield library,
* the most obvious difference being the different file you need to include:
*/
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
@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": "ป้อมปราบ"
},
@anoochit
anoochit / home.dart
Created October 31, 2023 05:23
consult bottom navigation
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@anoochit
anoochit / post_items.json
Last active October 5, 2023 16:56
post item example
[
{
"id": 1,
"user": {
"name": "Awesom User",
"avatarUrl": "https://i.pravatar.cc/300"
},
"content": "Hello",
"type": "text",
"datetime": "2023-10-04 22:10:42"