Skip to content

Instantly share code, notes, and snippets.

View xnzacc's full-sized avatar

Zac Z. xnzacc

  • UK
View GitHub Profile
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@karpathy
karpathy / add_to_zshrc.sh
Created August 25, 2024 20:43
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@manonthemat
manonthemat / tech_details.md
Last active August 10, 2024 10:43
Benefits Application using Neo4j and the Cardano Blockchain

Benefits Application

Project Scope

A benefits application where organizations (e.g. companies) can contribute funds regularly (always on the first day of a month) to the benefits accounts of individuals (e.g. employees).

Individuals should have detailed and aggregate insights into their benefits. Funds in a benefit account can be spent with suitable service providers.

Deliverables

@kalaschnik
kalaschnik / RStudio-in-WSL2.md
Last active March 14, 2024 20:41
Run RStudio in the Windows Subsystem for Linux 2 (WSL 2) using Pengwin and X410
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 13, 2026 13:13
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active March 6, 2026 18:18
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@omnibs
omnibs / phoenix showdown rackspace onmetal io.md
Last active February 23, 2026 13:46
Phoenix Showdown Comparative Benchmarks @ Rackspace

Comparative Benchmark Numbers @ Rackspace

I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.

Results

Framework Throughput (req/s) Latency (ms) Consistency (σ ms)
@Kartones
Kartones / postgres-cheatsheet.md
Last active March 13, 2026 05:30
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@Arkham
Arkham / vimrc
Created March 24, 2014 16:50
Convert old rspec should syntax to new expect syntax
function! ConvertShouldToExpect()
let rspec_conversions = {
\ 'should': 'to',
\ 'should_not': 'not_to',
\ 'should_receive': 'to receive',
\ 'should_not_receive': 'not_to receive',
\ }
for [old, new] in items(rspec_conversions)
execute "normal! " . ':%s/\v^(\s+)(.+)\.' . old . '>/\1expect(\2).' . new . '/ge' . "\<CR>"
@xnzacc
xnzacc / github-fetch-forks
Last active December 25, 2015 16:09
Fetch all forks of github repository. Uses gems 'github_api' and 'hub'
#!/usr/bin/env ruby
# Install gems:
# gem install github_api
# gem install hub
#
# Then run script in github repo
require 'github_api'
g = Github.new