Skip to content

Instantly share code, notes, and snippets.

View quag's full-sized avatar

Jonathan Wright quag

View GitHub Profile
@quag
quag / model.py
Created June 24, 2021 19:03
A partial Treesheets cts file parser in python
from __future__ import annotations
import datetime
import enum
from dataclasses import dataclass, field
from typing import Iterator, Optional
class CT(enum.Enum):
DATA = 0
"""
Sample output:
```
range: 19.7 → 30.9
mean: 25.06
19.6 (0.0%)
20.0 (0.1%)
20.4 █ (0.1%)
curl 'https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/compilers/dotnet/sdk/default.nix' > dotnet-sdk.nix
cat > default.nix << EOF
with import <nixpkgs> {};
rec {
dotnet-sdk = pkgs.callPackage ./dotnet-sdk.nix { };
}
EOF
module Plecto
let PHI = 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374847 // https://oeis.org/A001622
let PI = System.Math.PI
let TAU = 2.*PI
let E = System.Math.E
let inline fma m a x = x*m + a
let inline mix x0 x1 x = fma (x1-x0) x0 x
let inline map x0 x1 y0 y1 =
@quag
quag / blocks.json
Created October 2, 2011 05:02
Update attempt 1 for Minecraft 1.8 and 1.9 pre
[
{"blockId": 0, "name": "Air", "color": "#fefeff01", "empty": true },
{"blockId": 1, "name": "Stone", "color": "#7d7d7d" },
{"blockId": 2, "name": "Grass", "color": "#52732c" },
{"blockId": 3, "name": "Dirt", "color": "#866043" },
{"blockId": 4, "name": "Cobblestone", "color": "#757575" },
{"blockId": 5, "name": "WoodenPlank", "color": "#9d804f" },
{"blockId": 6, "data": [0,4,8,12], "name": "Sapling.Default", "color": "#5d7e1e", "item": true },
{"blockId": 6, "data": [1,5,9,13], "name": "Sapling.Spruce", "color": "#779656", "item": true },
{"blockId": 6, "data": [2,6,10,14], "name": "Sapling.Birch", "color": "#30341e", "item": t
@quag
quag / blocks.json
Created August 26, 2011 19:48
blocks.json 1.6
[
{"blockId": 0, "name": "Air", "color": "#fefeff01", "empty": true },
{"blockId": 1, "name": "Stone", "color": "#7d7d7d" },
{"blockId": 2, "name": "Grass", "color": "#52732c" },
{"blockId": 3, "name": "Dirt", "color": "#866043" },
{"blockId": 4, "name": "Cobblestone", "color": "#757575" },
{"blockId": 5, "name": "WoodenPlank", "color": "#9d804f" },
{"blockId": 6, "data": [0,4,8,12], "name": "Sapling.Default", "color": "#5d7e1e", "item": true },
{"blockId": 6, "data": [1,5,9,13], "name": "Sapling.Spruce", "color": "#779656", "item": true },
{"blockId": 6, "data": [2,6,10,14], "name": "Sapling.Birch", "color": "#30341e", "item": t
@quag
quag / dirsize.c
Created July 9, 2011 23:19
Find the size of a directory
#include <errno.h>
#include <string.h>
#include <fts.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
int main(int argc, char** argv)
{
First, check the history before starting.
~/homebrew master $ git log --oneline origin/master..master
e2d12f5 Merge branch 'master' of github.com:jauricchio/homebrew
12d6d0d New formula for cuetools.
4173905 New formula for quilt.
fa5608a New formula for quilt.
07a9d50 New formula for patchutils.
From fa9d42a90dcb649943e8444b504245f1863b2b21 Mon Sep 17 00:00:00 2001
From: Jonathan Wright <[email protected]>
Date: Fri, 20 Nov 2009 20:26:03 +1300
Subject: [PATCH] Fixing left/right up/down switch
---
sample.go | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sample.go b/sample.go
6g -o _go_.6 example.go a.go
a.go:1: package a; expected main
make: *** [_go_.6] Error 1