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
adrienbrault /
Last active April 22, 2024 08:47
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see
# Clone llama.cpp
git clone
cd llama.cpp
# Build it
make clean
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
pervognsen /
Last active January 27, 2024 19:54
Shift-based DFAs

A traditional table-based DFA implementation looks like this:

uint8_t table[NUM_STATES][256]

uint8_t run(const uint8_t *start, const uint8_t *end, uint8_t state) {
    for (const uint8_t *s = start; s != end; s++)
        state = table[state][*s];
    return state;
ErikAugust / spectre.c
Last active May 16, 2024 10:27
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#include <x86intrin.h> /* for rdtscp and clflush */
# many settings from
# many settings from
# my previous install notes at
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\n$fmt\n" "$@"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
#include <windows.h>
void error(const char *str) {
#!/usr/bin/env bash
set -e
if [ -e static ]; then
rm -r static
mkdir -p static
sass src/sass/main.scss > static/application.css
$(npm bin)/browserify src/js/main.js > static/application.js
nilsjesper / Random Donald Trump Word Salad Robot
Last active November 23, 2016 16:18
This is a quick bash script to make your Mac speak a random line from Donald Trump's Washington Post Editorial Interview. Because it sounds even crazier spoken by your computer. Just copy and paste into your terminal and hit return.
curl -s -N --location \
| perl -0ne 'my @list = $_ =~ m/<p>TRUMP:(.*?)<\/p>/smg; print $list[rand @list]' \
| say --progress -i -r 300 -v Alex
jcs /
Last active April 2, 2024 20:18
OpenBSD (with encrypted softraid) on the Chromebook Pixel (2015)
bishboria /
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links