Skip to content

Instantly share code, notes, and snippets.

View lantos1618's full-sized avatar
🐙
yeet

Lantos lantos1618

🐙
yeet
View GitHub Profile
@lantos1618
lantos1618 / main.go
Created February 10, 2024 16:39
go gin htmx google auth websockets
package main
import (
"encoding/json"
"fmt"
"html"
"log"
"net/http"
"os"
@lantos1618
lantos1618 / example.zen
Created February 8, 2024 17:54
example.zen
// this is a comment
Node: Type {
data: T
next: Box<Node<T>>
}
LinkedList: Type<T> {
head: Box<Node<T>>
@lantos1618
lantos1618 / llvm.nim
Created January 29, 2024 12:05
llvm_nim.nim
# this is just an example to get you started. a typical library package
# exports the main api in this file. note that you cannot rename this file
# but you can remove it if you wish.
# import trash_nim/submodule
# import llvm/core
import sequtils, options, tables, unicode, strutils, sugar, json, marshal
# {.passc: gorge(" llvm-config --cflags").}
@lantos1618
lantos1618 / xor_nn.py
Created January 16, 2024 12:24
a simple neural network in python numpy
import numpy as np
# Define the sigmoid activation function
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# Define the derivative of the sigmoid function
def sigmoid_derivative(x):
return x * (1 - x)
import net, asyncnet, asyncdispatch
proc ms_greet(s: AsyncSocket | Socket): Future[void] {.multisync.} =
await s.send("hi")
proc s_greet(s: Socket): void =
s.send("hi")
proc as_greet(s: AsyncSocket): Future[void] {.async.} =
await s.send("hi")
@lantos1618
lantos1618 / sse_chat.go
Created January 4, 2024 12:26
simple chat with chat room
package main
import (
"bufio"
"fmt"
"sync"
"github.com/chasefleming/elem-go"
"github.com/chasefleming/elem-go/attrs"
"github.com/chasefleming/elem-go/htmx"
@lantos1618
lantos1618 / llvm_main.nim
Created January 1, 2024 14:56
simple programming langauge
# this is just an example to get you started. a typical library package
# exports the main api in this file. note that you cannot rename this file
# but you can remove it if you wish.
# import trash_nim/submodule
# import llvm/core
import sequtils, options, tables, unicode, strutils, sugar, json, marshal
# {.passc: gorge(" llvm-config --cflags").}
@lantos1618
lantos1618 / llvm.nim
Created December 27, 2023 21:17
nim llvm
# this is just an example to get you started. a typical library package
# exports the main api in this file. note that you cannot rename this file
# but you can remove it if you wish.
# import trash_nim/submodule
# import llvm/core
import sequtils, options
# {.passc: gorge(" llvm-config --cflags").}
@lantos1618
lantos1618 / htmx.zig
Created December 26, 2023 15:14
htmx in zig
const std = @import("std");
const EleKind = enum {
NewDocument,
Html,
DocType,
Head,
Body,
Meta,
Link,
@lantos1618
lantos1618 / htmx.py
Created December 26, 2023 15:13
Htmx in python
from enum import Enum
from typing import Dict, List, Optional, Callable, Any, Type, TypeVar, Union
from enum import Enum
from typing import Union
from typing_extensions import Self
import inspect
from dataclasses import dataclass
class Tag(Enum):