Skip to content

Instantly share code, notes, and snippets.

View nfultz's full-sized avatar
🌯

Neal Fultz nfultz

🌯
View GitHub Profile
@lifepillar
lifepillar / reactive-framework.vim
Created December 29, 2023 17:33
Building a Reactive Library from Scratch in Vim 9 Script
vim9script
# Translation into Vim 9 script of the tutorial at:
# https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p
# Helper functions and classes {{{
def IndexOf(items: list<any>, item: any): number
return indexof(items, (_, e) => e is item)
enddef
@rain-1
rain-1 / llama-home.md
Last active September 6, 2024 03:26
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
from github import Github
import os
g = Github(os.getenv("GITHUB_TOKEN"))
u = g.get_user("....")
for repo in u.get_repos():
print(repo.html_url)
value = input("Delete y/n?")
if value.lower() == "y":
print("Deleting: {}".format(repo.html_url))
@zeux
zeux / clang27.md
Last active January 27, 2024 11:45
How does clang 2.7 hold up in 2021?

A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?

For people who aren't aware, Proebsting's law states:

Compiler Advances Double Computing Power Every 18 Years

Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.

Let's C about this

# Hash, displace, and compress: http://cmph.sourceforge.net/papers/esa09.pdf
# This is expected linear time for any seeded hash function that acts like a random hash function (universality isn't enough).
# (Actually, the code as written is O(n log n) when targeting 100% load. It's O(n) when targeting any smaller load factor.)
# You can make keys_per_bucket higher than the default of 4 but construction time will start to increase dramatically.
# The paper this is based on compresses the seeds (so the fact that the algorithm tries seeds in increasing order is important)
# which brings the representation size close to the information-theoretical minimum. I don't do any of that here, but it could
# be done as a postprocess.
def make_perfect_hash(keys, load_factor=1.0, keys_per_bucket=4, rhash=murmurhash, max_seed=1000000):
m = int(len(keys) / load_factor)
r = int(len(keys) / keys_per_bucket)
@skeeto
skeeto / README.md
Last active December 20, 2021 14:00
AI driving simulation
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active May 29, 2024 12:35
My growing list of Rust programs to use.
@probonopd
probonopd / Wayland.md
Last active September 19, 2024 18:58
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@tomcarpenter
tomcarpenter / example.R
Last active July 6, 2020 04:11
Code for graph
library(mvtnorm)
library(TruncatedNormal)
library(rockchalk)
library(tidyverse)
# Basic information about IATs
# IAT ~ mean = 0, sd = .45, trunc @ +/-2
# preference ~ mean @ 4, SD =?, trun @ 1-7
@levihb
levihb / README.MD
Last active October 23, 2020 18:00

Bash fzf directory history

render1587053748605

UPDATE: removed duplicates, now requires python

This little script allows you to access your directory history using fzf. Directory history is included for that session and for all previous sessions.

All methods of changing directories should be supported, as the script does not change cd, but just checks for a change in directory after each new command.