Skip to content

Instantly share code, notes, and snippets.

View hmmftg's full-sized avatar
🎯
Let's Go

حمید ملک محمدی hmmftg

🎯
Let's Go
  • PooyaCo. Inc.
  • Iran
View GitHub Profile
@hmmftg
hmmftg / server.go
Created June 9, 2024 11:19
Chat Server Using Golang Tcp
package main
import (
"bufio"
"fmt"
"log"
"net"
)
var allClients map[string]*Client
@hmmftg
hmmftg / edges.js
Created June 9, 2024 12:34
Display graph using memgraph
const edges = [
{
"id": 0,
"start": 37,
"end": 51,
"label": "Castillo"
},
{
"id": 1,
"start": 133,
@hmmftg
hmmftg / atm_machine.ts
Created June 16, 2024 16:01
Atm StateMachine Using XState
import { setup } from "xstate";
export const machine = setup({
types: {
context: {} as {},
events: {} as
| { type: "enter_amount" }
| { type: "enter_national_id" }
| { type: "account_is_valid" }
| { type: "account_is_invalid" }
@hmmftg
hmmftg / serve.go
Last active November 29, 2024 09:36 — forked from paulmach/serve.go
Simple Static File Server in Go
/*
Serve is a very simple static file server in go
Usage:
-p="8100": port to serve on
-d=".": the directory of static files to host
-b="/": the base URL to host
Navigating to http://localhost:8100 will display the index.html or directory
listing file.