Skip to content

Instantly share code, notes, and snippets.

View neon-sunset's full-sized avatar
💭
So ARM64 has FJCVTZS for JS but nothing to count UTF-8 code point length :(

neon-sunset

💭
So ARM64 has FJCVTZS for JS but nothing to count UTF-8 code point length :(
View GitHub Profile
@chr15m
chr15m / aider-convention-scraper
Last active April 18, 2025 14:40
Convert documentation URLs to Markdown "convention" files to be used by aider and other LLMs
#!/bin/sh
# Scrapes documentation from a URL and converts it to Markdown suitable for aider convention files
# to provide context to the LLM.
if [ $# -eq 0 ]; then
echo "Usage: $(basename "$0") <URL> [URL...]"
echo
echo "Generate aider 'convention' Markdown context from documentation URLs."
echo "suitable for providing LLM context about a project's conventions and style."
@waf
waf / Program.cs
Last active July 21, 2024 13:30
Complete program that plays MineSweeper in the terminal in 100 non-whitespace lines of code. Ported from https://radanskoric.com/experiments/minesweeper-100-lines-of-clean-ruby
if (args.Length == 3)
{
Play(args.Select(int.Parse).ToArray());
}
else
{
Console.WriteLine("Usage: Minesweeper width height mineCount (e.g. Minesweeper 12 6 6)");
}
static void Play(params int[] args)
@vova-lantsov-dev
vova-lantsov-dev / ShareWish.WebApi.csproj
Last active April 12, 2024 01:41
Build and publish .NET 8 application to GitHub Container Registry (ghcr.io) for linux/amd64 and linux/arm64
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<LangVersion>12</LangVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
@Ilchert
Ilchert / U8File.cs
Last active January 11, 2024 01:39
using System.Buffers;
using System.IO.Pipelines;
using System.Runtime.CompilerServices;
using U8;
using U8.InteropServices;
namespace _1brc
{
internal class U8File
{
@Birch-san
Birch-san / code-assist.md
Last active March 4, 2024 19:32
Local VSCode AI code assistance via starcoder + 4-bit quantization in ~11GB VRAM

Install HF Code Autocomplete VSCode plugin.

We are not going to set an API token. We are going to specify an API endpoint.
We will try to deploy that API ourselves, to use our own GPU to provide the code assistance.

We will use bigcode/starcoder, a 15.5B param model.
We will use NF4 4-bit quantization to fit this into 10787MiB VRAM.
It would require 23767MiB VRAM unquantized. (still fits on a 4090, which has 24564MiB)!

Setup API

@yang10560
yang10560 / chatGPT tools Plus.js
Last active May 28, 2023 02:12
Google、必应、百度、Yandex、360搜索、谷歌镜像、搜狗、b站、Fsou、duckduckgo、CSDN侧边栏Chat搜索,集成国内一言,星火,天工,通义AI。即刻体验AI,无需翻墙,无需注册,无需等待!
// ==UserScript==
// @name chatGPT tools Plus(修改版)
// @namespace http://tampermonkey.net/
// @version 2.6.2
// @description Google、必应、百度、Yandex、360搜索、谷歌镜像、搜狗、b站、Fsou、duckduckgo、CSDN侧边栏Chat搜索,集成国内一言,星火,天工,通义AI。即刻体验AI,无需翻墙,无需注册,无需等待!
// @author 夜雨
// @match https://cn.bing.com/*
// @match https://www.bing.com/*
// @match *://*.bing.com/*
// @match https://chat.openai.com/chat
@rain-1
rain-1 / LLM.md
Last active April 8, 2025 13:49
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

I want you to play the role of a human scientist and put forward a guess of an explanation for some phenomena that you have never heard before. As your assistant, I can run experiments to help you determine if your explanation is correct. Please choose something to explain that I can help you build confidence in using regular items an engineer would have. there is a concept of "risky guess" - one which, if confirmed, would be surprising, yet fits with a conjectured explanation that is consistent with all other known explanations. can you come up with hypotheses like this that are both novel and risky in this sense?
Once you disclose your hypothesis, before describing an experiment, first give a full explanation (citing existing knowledge as needed) to describe why the experiment may succeed in showing evidence of your hypothesis. Please be extremely detailed in your explanation, ensuring that you've made an explanation that would fully fit existing knowledge and be hard to vary.
@skittleson
skittleson / method-example.cs
Last active April 26, 2023 19:08
Cross platform audio player in dotnet
// I've used a lot of libs including the popular ones for dotnet such as NAudio but all seem to be overly complicated or not cross platform.
// 1. install ffplay on your platform. for Windows `choco install ffplay`. Debian `apt install ffmpeg`.
// 2. install nuget pkg `CliWrap`
// 3. send your audio stream to the method.
public static async Task PlayAsync(Stream stream, CancellationToken cancellationToken)
{
var result = await Cli.Wrap("ffplay")
.WithStandardInputPipe(PipeSource.FromStream(stream))
.WithArguments($"-autoexit -nodisp -hide_banner -loglevel error -fs -")
@FCLC
FCLC / A not so brief discussion of Alder Lake, the new AVX512 FP 16 extensions, Sapphire Rapids, its history, and why it requires a custom kernel.md
Last active August 8, 2024 02:30
On AVX512 FP16, Alder Lake, custom kernels, and how "Mistakes were made" has never rang so true

Warning: This is going to be a long one.  

  

I'm assuming general knowledge of x86_64 hardware extensions, and some insight into the workings of large hardware vendors. 

Understanding why AVX512 is useful not only in HPC, but also for gamers in emulation, or more efficient use of executions ports is a bonus. 

You don't need to have published 2 dozen papers on optimizing compute architecture.