Skip to content

Instantly share code, notes, and snippets.

View anoochit's full-sized avatar

Anuchit Chalothorn anoochit

View GitHub Profile
@anoochit
anoochit / note.txt
Created May 24, 2022 03:03
Flutter 3 live session note
What's new in Flutter 3 ?
===========
- Fully support 6 platforms iOS, Android, Web, macOS, Linux, Windows
- Flutter SDK on macOS now support ARM M1 and x86
- macOS desktop app, usecase from SuperList
- Flutter for Web has a better performance aka List/Scroll
@anoochit
anoochit / gift.sol
Last active May 11, 2022 23:59
social network wallet - gift token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.6.0/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC20/ERC20.sol";
contract GIFT is ERC20 {
using SafeERC20 for ERC20;
constructor() ERC20("GIFT Token", "GIFT") {
_mint(msg.sender, 1000000000 * 10 ** decimals());
@anoochit
anoochit / swap.sol
Created May 11, 2022 23:53
social network wallet - swap
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.6.0/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts@4.6.0/token/ERC20/ERC20.sol";
contract SWAPToken {
using SafeERC20 for ERC20;
@anoochit
anoochit / 05_faucet.sol
Created April 26, 2022 11:49
solidity faucet coin
// SPDX-License-Identifier: MIT
// Author: Jacob Suchorabski
pragma solidity >= 0.7.0 <= 0.7.4;
contract Faucet{
address owner;
mapping (address => uint) timeouts;
event Withdrawal(address indexed to);
@anoochit
anoochit / default
Created April 13, 2022 04:08
nginx reverse proxy script for vue frontend for mars blockchain
..
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
proxy_pass http://localhost:3000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
@anoochit
anoochit / marsd.service
Created April 13, 2022 04:06
mars unit file for systemd
#/etc/systemd/system/marsd.service
[Unit]
Description=Mars Node
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/root/go/bin/marsd start --
@anoochit
anoochit / start.sh
Created April 13, 2022 04:03
mars blockchain start vue front-end script for using with pm2
#!/bin/bash
cd /root/mars/vue
npm run dev
@anoochit
anoochit / evmosd.service
Created March 19, 2022 02:23
evmosd service
# /etc/systemd/system/evmosd.service
[Unit]
Description=Evmos Node
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/go/bin/evmosd start
@anoochit
anoochit / liff.dart
Created March 14, 2022 13:34 — forked from nukotsuka/liff.dart
LIFF SDK wrapper for Dart generated by js_facade_gen
@JS()
library liff;
import 'package:js/js.dart';
import 'package:js/js_util.dart' show promiseToFuture;
@JS()
external Liff get liff;
@anonymous
@anoochit
anoochit / faucet.sol
Created February 25, 2022 14:45
Faucet
// SPDX-License-Identifier: MIT
// Author: Jacob Suchorabski
pragma solidity >= 0.7.0 <= 0.7.4;
contract Faucet{
address owner;
mapping (address => uint) timeouts;
event Withdrawal(address indexed to);