Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active October 27, 2026 06:39
microgpt
"""
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
@didi1357
didi1357 / KodiStandaloneRaspberryPiOsLite.md
Last active January 10, 2026 19:21
Kodi Standalone on Raspberry Pi OS Lite 64Bit Debian 12 Bookworm

Kodi Standalone on Raspberry Pi OS Lite 64Bit Debian 12 Bookworm

This guide describes how to get Kodi running on Debian Bookworm based Raspberry Pi OS Lite 64Bit without having to run the full LXDE GUI of the desktop version.

It is based on this guide.

First, install kodi as usual with

apt install kodi

@bnhf
bnhf / README.md
Last active September 16, 2026 05:05
Tailscale - Deploying with Docker and Portainer

Just thought I'd put together some detail on deploying Tailscale using Docker and Portainer. These bits-and-pieces are available elsewhere, but not together, so hopefully this will save someone a bit of time if you'd like to add Tailscale to an existing Docker install:

Here's my annotated recommended docker-compose, to use with Portainer-Stacks. Note that I'm not using a pre-made Auth Key. I started that way, but realized it was very easy to simply check the Portainer log for the tailscaled container once the stack is running. In that log you'll see the standard Auth link that you can use to authorize the container. This way you don't need to create a key in advance, or create a reusable key that introduces a security risk:

version: '3.9'
services:
  tailscale:
    image: tailscale/tailscale
    container_name: tailscaled
"ChatGPT, please act as a supportive listener and provide empathetic responses while we discuss my thoughts and feelings."
"Assume the role of a virtual counselor, offering me guidance and encouragement as we talk about my personal challenges."
"Please take on the persona of a life coach, helping me explore my thoughts and emotions, and providing gentle guidance in our conversation."
"Adopt the role of a friendly advisor, offering compassionate and non-judgmental responses as we discuss various aspects of my life."
"ChatGPT, become a therapeutic conversation partner, providing a safe space for me to express my thoughts, feelings, and concerns, while offering supportive feedback."
@tdpetrou
tdpetrou / basictransformer.py
Last active September 7, 2023 13:44
A custom scikit-learn transformer for one-hot encoding categorical values, and standardizing numeric columns
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator
class BasicTransformer(BaseEstimator):
def __init__(self, cat_threshold=None, num_strategy='median', return_df=False):
# store parameters as public attributes
self.cat_threshold = cat_threshold
@Yatoom
Yatoom / setup.md
Last active September 27, 2026 20:13
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@tlc
tlc / humble_bundle_file_downloader.js
Last active March 25, 2020 08:58 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
@muktupavels
muktupavels / toggle-decorations.c
Last active October 7, 2024 02:58
Simple app to toggle window decorations.
/*
* Copyright (C) 2017 Alberts Muktupāvels
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@mosquito
mosquito / README.md
Last active August 29, 2026 20:46
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@zilexa
zilexa / scantokodi.sh
Created July 15, 2016 19:27
Let Transmission notify Kodi of a finished download so that it will scan that particular file to the library (it will not do a full library update)
/usr/bin/wget --header='Content-Type:application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "osmc", "params": {"directory":"'"$TR_TORRENT_DIR"'/"}}' "http://localhost:8080/jsonrpc"