Skip to content

Instantly share code, notes, and snippets.

View paulsmith's full-sized avatar
😀
Hi, friends

Paul Smith paulsmith

😀
Hi, friends
View GitHub Profile
@paulsmith
paulsmith / LLM.md
Created May 2, 2023 13:47 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@paulsmith
paulsmith / echo.go
Created January 12, 2011 06:09
A simple echo server testing a few interesting Go language features, goroutines and channels.
// $ 6g echo.go && 6l -o echo echo.6
// $ ./echo
//
// ~ in another terminal ~
//
// $ nc localhost 3540
package main
import (
/**
* 8x8 monochrome bitmap fonts for rendering
* Author: Daniel Hepper <daniel@hepper.net>
*
* License: Public Domain
*
* Based on:
* // Summary: font8x8.h
* // 8x8 monochrome bitmap fonts for rendering
* //
@paulsmith
paulsmith / echo.c
Created October 7, 2009 18:40
Unix is C—a preforking echo server inspired by tomayko.com and jacobian.org’s recent “* is Unix” posts
/**
* A simple preforking echo server in C.
*
* Building:
*
* $ gcc -Wall -o echo echo.c
*
* Usage:
*
* $ ./echo
enum Kind {
File,
Directory,
}
struct Entry {
name: String,
kind: Kind,
size: usize,
parent: Option<usize>,
@paulsmith
paulsmith / Makefile
Last active October 5, 2022 09:26
Simple integer sum function, JIT'ed with the LLVM C API
CC=clang
CXX=clang++
all: sum
sum.o: sum.c
$(CC) -g `llvm-config --cflags` -c $<
sum: sum.o
$(CXX) `llvm-config --cxxflags --ldflags --libs core executionengine jit interpreter analysis native --system-libs` $< -o $@
@paulsmith
paulsmith / verbatim_templatetag.py
Created October 25, 2011 19:03 — forked from ericflo/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@paulsmith
paulsmith / when-to-use-generics.md
Created December 21, 2021 17:51
When to use generics in Go

When to use generics

aka generic guidelines

It's late 2021, and Go is about to add "generics" (i.e., type parameters for types and functions) to upcoming release version 1.18.

Here is some guidance for Go programmers, cribbed from a talk by Ian Lance Taylor.

First, write Go programs by writing code, not by defining types.

@paulsmith
paulsmith / logproxy.go
Created July 11, 2013 04:05
Logging TCP proxy, with SSL/TLS support
package main
import (
"crypto/tls"
"flag"
"fmt"
"io"
"log"
"net"
"os"
@paulsmith
paulsmith / mybar.txt
Created June 22, 2021 14:58
Created from Remix Form!
The quick brown fox jumps over the lazy dog.