Skip to content

Instantly share code, notes, and snippets.

View codewithcats's full-sized avatar
🐱
Building something big

Tanawat Tassana codewithcats

🐱
Building something big
View GitHub Profile

FSX

Todo

  • เพิ่มข้อมูลในแต่ละขั้นตอนที่ contact กับระบบ

ตั้งแต่ Sale ไปจนถึง first contact ของ OP

sequenceDiagram
    actor Sale
import { Observable, Subject } from "rxjs";
import { filter } from "rxjs/operators";
export interface TopicMessage {
topic: string;
data?: any;
}
const topics$: Subject<TopicMessage> = new Subject();
@codewithcats
codewithcats / create-slp-token.py
Created November 17, 2021 16:41
create slp token using bitcash
from bitcash import PrivateKeyRegtest
# Python program to demonstrate
# command line arguments
import sys
# total arguments
total_args = len(sys.argv)
# total_args also counts filename as an args so -1 out of it
if (total_args - 1) > 4:
@codewithcats
codewithcats / bch-toolkit-draft.md
Last active October 26, 2021 13:20
BCH Toolkit Draft

About

This repo intends to be a toolkit for running a local version of a Bitcoin Unlimited for development and testing purposes. Currently it provides a self-hosted local node, indexer (Electrs), a drop-in Ninsight replacement (Opensight), a regtest version of the rest.bitcoin.com REST APIs, an instance of SLPDB for token querying.

Prerequisites

Too many things to get it running. Most of them needed because of the way we implement our script. We can put them into container and requires only Docker to start.

@codewithcats
codewithcats / Main.elm
Created December 11, 2020 12:21 — forked from pablen/Main.elm
DOM mutation observer helper that will run a hook when a DOM node matching a selector is mounted or unmounted. This pattern is particularly useful for working with external JS libraries in your Elm apps, using minimal amount of code. The helper leverages the MutationObserver API (https://developer.mozilla.org/es/docs/Web/API/MutationObserver).
-- Somewhere in you Elm app you can add editor by adding an empty node with the correct attributes.
-- The JS library will be initialized and destroyed automatically!
view : Model -> Html Msg
view model =
div []
[ div
[ attribute "data-ace" ""
, attribute "data-ace-theme" "monokai"
, attribute "data-ace-mode" "javascript"
calendar : Svg msg
calendar =
svg [ viewBox "0 0 16.498 16.498" ]
[ Svg.path
[ d "M7.027,6.222V3m6.444,3.222V3M6.222,9.444h8.055M4.611,17.5H15.887A1.611,1.611,0,0,0,17.5,15.887V6.222a1.611,1.611,0,0,0-1.611-1.611H4.611A1.611,1.611,0,0,0,3,6.222v9.666A1.611,1.611,0,0,0,4.611,17.5Z"
, transform "translate(-2 -2)"
, fill "none"
, stroke "#292929"
, strokeLinecap "round"
, strokeLinejoin "round"
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=" />
viewMap : PreviewModel -> Html PreviewMsg
viewMap { location } =
div [ class "preview-field" ]
[ label [ class "preview-field-label" ] [ text TCO.previewLocationLabel ]
, img [ class "preview-field-info preview-map", src <| createPreviewMapSrcUrl location ] []
]
createPreviewMapSrcUrl : Location -> String
createPreviewMapSrcUrl l =
[{"value":10079,"walletAddress":"0x19e81d2a179b1c50c459039c7aab4160c3026e35","rank":0},{"value":10077,"walletAddress":"0x65014e29544c80202255e44cec7a510e5fb75d31","rank":1},{"value":10074,"walletAddress":"0x0774a302c8675c92b9a4ed1de6e559b919a39a8a","rank":2},{"value":10074,"walletAddress":"0xa14bafc2264be5370325a3fa9f84bd07996631e2","rank":3},{"value":10073,"walletAddress":"0x5f354835d9cac47b354c1d7790dc05178850665a","rank":4},{"value":10069,"walletAddress":"0x61aa24cf589bcc2a3a7ec5f60321931ba56c91a9","rank":5},{"value":10068,"walletAddress":"0x37b0f8ab672fc0065258a03923aebcde5089716f","rank":6},{"value":10062,"walletAddress":"0x9223726d9cc5aaf3fd8a1047fd495d71411d9120","rank":7},{"value":10062,"walletAddress":"0x68443f16cd784b383829ce2242aaf24398d07d17","rank":8},{"value":10061,"walletAddress":"0xa95cca45dcd1e361bbd39232391262e9b4b6cd38","rank":9},{"value":10061,"walletAddress":"0x2827538ddc2fa40c634e0b8aa02e75a8ac7c7905","rank":10},{"value":10058,"walletAddress":"0x2371da4f8b255ed9465524bbfab8811e4c834424",
type State
= Form (Maybe String)
| Success
| Error
parseUrl : Url.Url -> State
parseUrl url =
let
parser =