Skip to content

Instantly share code, notes, and snippets.

View icarroll's full-sized avatar
💭
Too much skin, not enough bees.

Isaac Carroll icarroll

💭
Too much skin, not enough bees.
  • US Pacific time zone
View GitHub Profile
@justarandomgeek
justarandomgeek / ROMGen.blueprint.lua
Last active December 9, 2017 08:39
CPU kit blueprint book. Requires Foreman, Nixies Tubes, and Color Coding.
do local foo="bar"
--[[ The line above must start with "do local" to be recognized as a decompressed blueprint.
Adjust rombase to control the first memory address the rom is generated for.
Adjust addrsignal below to control memory address signal. Requires a compatible machine, and address signal cannot be stored.
data is array of parameter lists for constant combinators.
strings are converted to serialized frames and appended to data. No terminators are added.
pixeldata is converted and added after strings.
]]
@WillDignazio
WillDignazio / o_tmpfile.c
Created July 25, 2013 07:57
__very__ simple O_TMPFILE usage, took me a little to figure out the requirements. O_TMPFILE requires MAY_WRITE privileges in the kernel, which can be explicitly achieved with O_RDWR flag. Requires linux >=3.11-rc2, which introduced O_TMPFILE into the mainline.
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
/*
* There may not be a userspace definition yet since
* at the time of this gist, 3.11 is only in rc2.
*/
#ifndef O_TMPFILE
@twanvl
twanvl / Sorting.agda
Last active December 2, 2022 16:44
Correctness and runtime of mergesort, insertion sort and selection sort.
module Sorting where
-- See https://www.twanvl.nl/blog/agda/sorting
open import Level using () renaming (zero to ℓ₀;_⊔_ to lmax)
open import Data.List hiding (merge)
open import Data.List.Properties
open import Data.Nat hiding (_≟_;_≤?_)
open import Data.Nat.Properties hiding (_≟_;_≤?_;≤-refl;≤-trans)
open import Data.Nat.Logarithm
open import Data.Nat.Induction