Skip to content

Instantly share code, notes, and snippets.

View stuartpb's full-sized avatar

Stuart P. Bentley stuartpb

View GitHub Profile
@stuartpb
stuartpb / demo.html
Last active February 10, 2018 14:23 — forked from kig/gzip.js
<!DOCTYPE html>
<html>
<head>
<script src="gzip.js"></script>
<script>
function showImg(f) {
var res = document.getElementById('results');
var e = document.createElement('div');
res.appendChild(e);
var p = document.createElement('p');
@stuartpb
stuartpb / deprecated-petlog.md
Last active May 7, 2017 23:27
Log of changes made to my Linode from after the point where I reinstalled the system image
@stuartpb
stuartpb / deprecated-petlog.md
Last active May 7, 2017 23:26
Log of config actions taken on my old removable Linux setup
@stuartpb
stuartpb / mkimgarpi.sh
Created October 2, 2015 23:56
Script to make a new Arch Linux for Raspberry Pi image
#!/bin/bash
# Packages required
# dosfstools parted
# Can be run on any Linux system
echo "creating image to fit on 1Gb card"
dd if=/dev/zero of=arch-rpi.img bs=1M count=925
echo "Partitioning"
@stuartpb
stuartpb / comment.md
Created August 17, 2016 17:18
Original version of markusfisch/ShaderEditor#10#issuecomment-240450626

What that means is, while a mediump can contain a value up to 1024 without losing integral precision (the next increment it will be able to represent is 1026), it can only represent fractions of any granularity for much smaller ranges - from 513 to 1024, it'd be wholes, 256 to 512 it'd be halves, 128 to 256 quarters, 64 to 128 eighths, 32 to 16 the largest fractions would be sixteenths. Only values absolutely smaller than 8 are precise to the 1/32, smaller than 4 1/64, smaller than 2 1/128, and only fractions below a whole are precise to 1/256 (2^-8) - fractions of precision 2^-9 or 2^-10 only being under a half and a quarter, respectively (and fractions beyond that having no guarantees of precision per the spec). (Conversely, 1026 to 2048 will jump by twos, 2052 to 4096 by fours, 4104 to 8192 by eights, and 8208 to 16384 by sixteens.)

(FAKE EDIT: I just checked the OP, and what I'm about to describe doesn't quite match its figures, though that could just be because I'm bad at estimating framerates.