Skip to content

Instantly share code, notes, and snippets.

View 42LM's full-sized avatar
😀

LM 42LM

😀
View GitHub Profile
@42LM
42LM / check_mime.go
Created September 9, 2025 11:38
go mime type check
// You can edit this code!
// Click here and start typing.
package main
import (
"fmt"
"mime"
)
func main() {
@42LM
42LM / migrate.go
Created September 9, 2025 11:37
go migrate test
package main
import (
"errors"
"fmt"
"path/filepath"
"sort"
"strconv"
"strings"
)
@42LM
42LM / mersenne_twister.go
Created September 9, 2025 11:36
go mersenne twister
package main
import (
"bufio"
"fmt"
"os"
)
// Mersenne Twister constants
const (
@42LM
42LM / md5.go
Created September 9, 2025 11:35
go MD5
package main
import (
"crypto/md5"
"encoding/hex"
"fmt"
)
func main() {
data := "145e86eb6a0e34d608f8ccbea57eb801"
@42LM
42LM / jsoneq.go
Created September 9, 2025 11:34
JSON equal go
package main
import (
"encoding/json"
"fmt"
"reflect"
)
func main() {
a := []byte(`{"bar":"foo","foo":"bar"}`)
@42LM
42LM / htmlnode.go
Created September 9, 2025 11:30
go html node
package main
import (
"bytes"
"fmt"
"os"
"golang.org/x/net/html"
)
@42LM
42LM / googlegemini.go
Created September 9, 2025 11:28
Google gemini go sdk
// https://aistudio.google.com/apikey
package main
import (
"context"
"fmt"
"log"
"os"
"google.golang.org/genai"
@42LM
42LM / csvgen.go
Created September 9, 2025 11:26
Scripts for CSV generation
package main
import (
"errors"
"fmt"
"os"
"github.com/42LM/gocsvgen/internal/csvgen"
charmlog "github.com/charmbracelet/log"
"github.com/urfave/cli/v2"
@42LM
42LM / sanitize.go
Created September 9, 2025 11:13
Chuck norris sanitize
package sanitize
import (
"html"
"reflect"
"regexp"
"unicode"
"unicode/utf8"
"github.com/microcosm-cc/bluemonday"
@42LM
42LM / simple_ascii_movie.go
Created September 9, 2025 11:09
Simple ASCII movie
package main
import (
"fmt"
"time"
)
func main() {
// Define the frames of the ASCII art movie
frames := []string{