Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / pubspec.yaml
Created December 17, 2022 03:37
How you can store an image in Cloud Firestore using Flutter
dependencies:
cloud_firestore: ^0.14.0+2
firebase_storage: ^4.0.0
@anoochit
anoochit / pfxgen.sh
Created November 5, 2022 10:01
generate pfx certificate
openssl genrsa 2048 > filessl.key
chmod 400 filessl.key
openssl req -new -x509 -nodes -sha256 -days 365 -key filessl.key -out filessl.crt
openssl pkcs12 -export -out filessl.pfx -inkey filessl.key -in filessl.crt
@anoochit
anoochit / wifimanager-esp32.ino
Last active October 2, 2022 09:18
ESP32 wifi manager and custom parameter SPIFFS
#include <FS.h> // this needs to be first, or it all crashes and burns...
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <ArduinoJson.h> // https://github.com/bblanchon/ArduinoJson
#ifdef ESP32
#include <SPIFFS.h>
#endif
//define your default values here, if there are different values in config.json, they are overwritten.
char mqtt_server[40];
@anoochit
anoochit / Podfile
Created September 25, 2022 02:10
podfile example
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
@anoochit
anoochit / Podfile
Last active September 24, 2022 13:08
speedup build time for firestore
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.5.0'
....
@anoochit
anoochit / stations.json
Created June 19, 2022 03:50
ev charging station
[
{
"id": "2",
"station_favorite": false,
"name": "สยามพารากอน",
"address": "ปทุมวัน, ปทุมวัน, กรุงเทพมหานคร",
"description": "GA [North] B18-B19,C18-C19",
"latitude": 13.745764,
"longitude": 100.53473,
"status": "ปิดบริการ",
@anoochit
anoochit / flutter_33_note.txt
Created September 6, 2022 02:41
Flutter 3.3 live session note
Flutter 3.3 live session note
* Stable release for all platforms
* SelectAbleArea widget
* Trackpad input
* MD3
* IconButton
@anoochit
anoochit / home_view.dart
Created September 1, 2022 02:54
sample tween animation
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../controllers/home_controller.dart';
class HomeView extends GetView<HomeController> {
const HomeView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
@anoochit
anoochit / chat.dart
Created August 13, 2022 05:34
chat message page
// show chat screen
import 'dart:developer';
import 'package:chat/consts.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
class ChatPage extends StatelessWidget {
ChatPage({Key? key, required this.roomId}) : super(key: key);
@anoochit
anoochit / blink.py
Created October 4, 2014 17:04
raspberry pi gpio blink example