Skip to content

Instantly share code, notes, and snippets.

View district10's full-sized avatar
😀
good good study, day day up

TANG ZhiXiong district10

😀
good good study, day day up
View GitHub Profile
@ento
ento / include-exclude-precedence.md
Created October 1, 2017 21:56
include-exclude-precedence

Include/exclude precedence in lint-like tools

Ad hoc research for deciding how to implement file inclusion/exclusion logic in elm-doc.

Notes:

  • Listed up lint-like tools I know off the top of my head, and then supplemented by cherry-picking tools from awesome-static-analysis
  • "Included" here means explicitly included by being specified in the command line, not just in a config file.
  • I either tried out each tool to see how it actually behaves, or looked at existing issues or actual code.
  • Numbers
@b01
b01 / download-vs-code-server.sh
Last active January 12, 2026 06:13
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
This file has been truncated, but you can view the full file.
@mdickinson
mdickinson / sqrt_exact.c
Last active February 18, 2026 16:31
Fast square root of a 64-bit square number
// Exact square root of a known square integer
// ===========================================
// This snippet contains a function `isqrt64_exact` with signature
//
// uint32_t isqrt64_exact(uint64_t n);
//
// `isqrt64_exact` computes the 32-bit square root of its unsigned 64-bit
// integer input, under the assumption that that input is a perfect square.
//
// Compile under gcc or clang with:
"""
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