Skip to content

Instantly share code, notes, and snippets.

//
//    
//  
//  
// 
const std = @import("std");
const reset = "\x1b[0m";
const bold = "\x1b[1m";
@42LM
42LM / server.xml
Created November 5, 2025 13:59
Original tomcat/catalina server.xml `/opt/homebrew/opt/tomcat/libexec/conf/server.xml`
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@42LM
42LM / unzip.go
Created September 20, 2025 07:33
unzip dartagnan template
package main
import (
"archive/zip"
"fmt"
"io"
"log"
"os"
"path/filepath"
"strings"
@42LM
42LM / rust-client.rs
Created September 17, 2025 08:57
Rust client
use std::borrow::Cow;
use std::collections::HashMap;
use std::io::{BufRead, BufReader, Read, Write};
use std::net::TcpStream;
use std::str;
#[derive(Debug)]
pub enum RequestMethod {
Get,
Post(Option<Vec<u8>>),
@42LM
42LM / multierror.go
Created September 17, 2025 08:28
go multierror
package main
import (
"errors"
"fmt"
)
func main() {
err1 := errors.New("error one")
err2 := errors.New("error two")
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
@font-face {
font-family:'MyFont';
src:url('PressStart2P-Regular.ttf') format('truetype');
font-weight:normal;
@42LM
42LM / zippy.go
Created September 9, 2025 11:44
zip stuff
package main
import (
"archive/zip"
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"strings"
@42LM
42LM / postform.go
Created September 9, 2025 11:42
go post form
package main
import (
"fmt"
"net/http"
)
func main() {
router := http.NewServeMux()
@42LM
42LM / dynamodb.go
Created September 9, 2025 11:41
go dynamodb client
package main
import (
"context"
"fmt"
"os"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue"
@42LM
42LM / multierror.go
Created September 9, 2025 11:39
go multierror
package main
import (
"errors"
"fmt"
)
func main() {
err1 := errors.New("error one")
err2 := errors.New("error two")