Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / esp8266-smart-config.ino
Created August 18, 2015 15:01
esp8266-smart-config
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
void setup() {
int cnt = 0;
// set for STA mode
WiFi.mode(WIFI_STA);
// put your setup code here, to run once:
@anoochit
anoochit / leanback_android_tv_flutter.md
Last active September 8, 2023 13:15
leanback android tv
  • Add software leanback feature in AndroidManifest
<uses-feature android:name="android.software.leanback" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  • Add banner icon xhdpi 320x180 px for banner
@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.

@anoochit
anoochit / mqtt-telegraf.conf
Created January 24, 2017 10:32
mqtt-telegraf.conf
# Telegraf Configuration
#
# Telegraf is entirely plugin driven. All metrics are gathered from the
# declared inputs, and sent to the declared outputs.
#
# Plugins must be declared in here to be active.
# To deactivate a plugin, comment out the name and any variables.
#
# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
# file would generate.
@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) {
@anoochit
anoochit / print_ticket.dart
Created December 27, 2022 15:14
thermal printer
// print test ticket
void printTicket() {
// make a screenshot with data
screenshotController
.captureFromWidget(
SizedBox(
width: 140,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@anoochit
anoochit / adpoint.dart
Last active December 17, 2022 11:16
loyalty card
import 'package:web3dart/web3dart.dart';
// Assume that the contract address and ABI are stored in variables
// called 'contractAddress' and 'contractAbi', respectively
// Create a new instance of the EthereumClient class
final client = Web3Client(rpcUrl, httpClient: httpClient);
// Load the contract using the contract address and ABI
final contract = DeployedContract(