Skip to content

Instantly share code, notes, and snippets.

View cristoper's full-sized avatar

chris cristoper

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
@SMUsamaShah
SMUsamaShah / list_of_p2p_file_sharing.md
Last active May 2, 2026 22:21
List of P2P file sharing tools

Browser Based

  1. Web Wormhole https://webwormhole.io/ https://github.com/saljam/webwormhole
  2. Localsend https://web.localsend.org/
  3. FilePizza https://file.pizza/
  4. ShareDrop sharedrop.io https://github.com/szimek/sharedrop (SOLD, not recommended, use one of the forks)
    1. A clone SnapDrop snapdrop.net https://github.com/RobinLinus/snapdrop (SOLD, not recommended, use one of the forks)
      1. A fork PairDrop https://pairdrop.net/ https://github.com/schlagmichdoch/pairdrop
  5. ToffeeShare https://toffeeshare.com/
  6. Instant.io https://instant.io/
@ityonemo
ityonemo / test.md
Last active May 7, 2026 10:12
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@romainl
romainl / Don't use Vim.md
Last active April 11, 2026 06:18
Don't use Vim for the wrong reasons

Don't use Vim

Don't do the crime, if you can't do the time.

-- Anthony Vincenzo "Tony" Baretta

Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.

Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.

# general settings
auto-reload yes
max-items 500
show-read-feeds no
text-width 50
reload-threads 11
# set browser for osx
browser /usr/bin/open -a "/Applications/Brave Browser.app" '%u'
@rmi1974
rmi1974 / how_to_manage_multiple_repositories_using_myrepos_tool.md
Last active February 21, 2026 02:30
How to manage multiple repositories using myrepos tool #myrepos #git #git-annex #git-bup

How to manage multiple repositories using myrepos tool

[myrepos][1]

You have a lot of version control repositories. Sometimes you want to update them all at once. Or push out all your local changes. You use special command lines in some repositories to implement specific workflows. Myrepos provides a mr command, which is a tool to manage all your version control repositories.

myrepos is a command-line tool which adds the mr command to your environment. mr does not care about different version control systems, it supports all of them.

The standard way to use mr is to go into each one of your repositories and run the command mr register for mr to add it to your configuration file in ~/.mrconfig.

@yegappan
yegappan / VimScriptForPythonDevelopers.MD
Last active April 8, 2026 10:46
Vim script for Python Developers

Vim Script for Python Developers

This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m

@nanmu42
nanmu42 / pkcs7padding.go
Last active March 5, 2026 20:38
Golang PKCS7 Padding/Unpadding
// pkcs7strip remove pkcs7 padding
func pkcs7strip(data []byte, blockSize int) ([]byte, error) {
length := len(data)
if length == 0 {
return nil, errors.New("pkcs7: Data is empty")
}
if length%blockSize != 0 {
return nil, errors.New("pkcs7: Data is not block-aligned")
}
padLen := int(data[length-1])