Skip to content

Instantly share code, notes, and snippets.

anoochit / thai-id-card.go
Created May 11, 2021 — forked from bouroo/thai-id-card.go
Thai National ID Card reader in GO
View thai-id-card.go
package main
// Require pcscd, libpcsclite
import (
anoochit / BankSmartContract.sol
Last active May 10, 2021
Basic Bank SmartContract
View BankSmartContract.sol
pragma solidity 0.6.6;
contract OPPBank {
int balance;
constructor() public {
function getBalance() view public returns(int) {
anoochit / wifimanager-esp32.ino
Last active May 9, 2021
ESP32 wifi manager and custom parameter SPIFFS
View wifimanager-esp32.ino
#include <FS.h> // this needs to be first, or it all crashes and burns...
#include <WiFiManager.h> //
#include <ArduinoJson.h> //
#ifdef ESP32
#include <SPIFFS.h>
//define your default values here, if there are different values in config.json, they are overwritten.
char mqtt_server[40];
View item-id-8u5h2m.json
"name": "Thor's hammer",
"description": "Mjölnir, the legendary hammer of the Norse god of thunder.",
"image": "https://game.example/item-id-8u5h2m.png",
"strength": 20
View OPPCoinERC20.sol
pragma solidity 0.6.6;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
anoochit / Dockerfile
Created Jun 16, 2020
Dockerfile to build dart container in small image **ONLY** x86_64 arch
View Dockerfile
FROM google/dart AS dart-runtime
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
  • Add software leanback feature in AndroidManifest
<uses-feature android:name="" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  • Add banner icon xhdpi 320x180 px for banner
anoochit / home.dart
Created Mar 11, 2021
adaptive layout with LayoutBuilder
View home.dart
import 'dart:developer';
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
_HomePageState createState() => _HomePageState();
View ble_advertrise.ino
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#include <iostream>
#include <string>
BLEServer* pServer = NULL;
BLECharacteristic* pCharacteristic = NULL;
anoochit / search.dart
Created Jan 26, 2021
simple search NOT recommended
View search.dart
Future<List<String>> searchTrip(String keyword) async {
List<String> docId = [];
var value = await FirebaseFirestore.instance.collection('trips').get(); {
var title = element['name'].toString().toLowerCase();
var body = element['body'].toString().toLowerCase();
if (body.contains(keyword)) docId.add(;
if (title.contains(keyword)) docId.add(;
return docId;