Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@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": "ป้อมปราบ"
@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 July 17, 2023 02:44
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

Moved to git repository: https://github.com/denji/nginx-tuning

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.