Skip to content

Instantly share code, notes, and snippets.

View gofenix's full-sized avatar
🎯
Focusing

Fenix gofenix

🎯
Focusing
  • Shenzhen
View GitHub Profile
@gofenix
gofenix / Hello.ts
Created October 27, 2022 13:50
hello world from FaaS3.
export function handler() {
return "hello world"
}
@gofenix
gofenix / sum.ts
Created October 25, 2022 16:18
this is a sum with delay 2s.
import axiod from "https://deno.land/x/axiod/mod.ts";
export async function handler(a: int, b: int) {
const { data } = await axiod<{ delay: string }>(
"https://postman-echo.com/delay/2"
);
console.log(data);
return a+b;
}
@gofenix
gofenix / console.ts
Last active October 23, 2022 02:39
MicroFaaS
export function handler() {
console.log(Deno)
}
@gofenix
gofenix / HelloWorld.ex
Created July 16, 2022 07:06
snippet for faas
defmodule CodeOnChain.HelloWorld do
@moduledoc """
this is a hello world snippet
"""
def get_module_doc, do: @module_doc
def hello_world() do
"hello world"
end
end
@gofenix
gofenix / sync.md
Last active July 10, 2018 12:06
sync demo
func syncDemo() {
	log.Println("start", time.Now())
	var t1, t2 int
	var err error
	var wg sync.WaitGroup
	wg.Add(2)
	go func(id int, wg *sync.WaitGroup) {
		defer wg.Done()
		time.Sleep(3 * time.Second)