Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar
😊

Anuchit Chalothorn anoochit

😊
View GitHub Profile
@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": "ป้อมปราบ"
@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"
@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 / rvm_state.txt
Last active August 23, 2023 01:30
rvm state
เปิดช่อง
----
{ "state":2 , "result": 1}
เช็คน้ำหนัก
----
{ "state":3 , "result": 1}
@anoochit
anoochit / nginx-tuning.md
Created May 3, 2023 05:09 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@anoochit
anoochit / flutter_github_ci.yml
Created March 18, 2023 02:22 — forked from rodydavis/flutter_github_ci.yml
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@anoochit
anoochit / avatar_layout.dart
Created February 28, 2023 13:34
FlutterFlow - Avatar Maker Custom widgets for
// Automatic FlutterFlow imports
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'package:flutter_svg/flutter_svg.dart';
@anoochit
anoochit / build.gradle
Created February 20, 2023 03:27 — forked from wendreof/build.gradle
7-How-to-Safely-Build-Assigned-Flutter-App-with-GitHub-Actions
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {