Skip to content

Instantly share code, notes, and snippets.

@stfwn
stfwn / check-rst-urls.sh
Created January 19, 2021 09:37
Find dead links in your ReStructuredText files
#!/bin/bash
# This script grabs ReStructuredText-style hyperlinks in all rst files from cwd down,
# then prints a list of status codes for a GET request to each of them. It's useful
# for finding dead links.
# This will match:
# - "<www.example.com>"
# - "<https://www.example.com"
# - "<https://example.com"
@stfwn
stfwn / nn.py
Last active December 21, 2020 04:32
A Neural Network in Python From Start to Finish
import numpy as np
import matplotlib.pyplot as plt
from urllib import request
import gzip
import pickle
import os
"""Load up the data.
This is not that interesting. Let's just copy paste it from https://github.com/hsjeong5/MNIST-for-Numpy."""
int isAsciiDigit(int x) {
int overflower = (1 << 31) ^ (~0x39);
int overflowed = (x + overflower) >> 31;
if (overflowed) {
printf("Overflowed, so not an AsciiDigit.\n");
}
return !overflowed & !((x >> 4) ^ 3);
}
# This pulls, overwrites the previous commit with the newly appended text and then pushes.
working-copy://x-callback-url/chain?key=...&repo=...&command=pull&command=write&text=...&path=...&mode=append&command=commit&message=...&command=push
# This pulls, correctly adds the new commit to the existing commit tree and then pushes.
working-copy://x-callback-url/chain?key=...&repo=...&command=pull&command=write&mode=append&text=...&path=...&command=commit&message=...&command=push
# The only difference is the positioning of the writing mode variable.

Keybase proof

I hereby claim:

  • I am stfwn on github.
  • I am stfwn (https://keybase.io/stfwn) on keybase.
  • I have a public key ASBvOIoK4IjQHMC3UOVkDZZx4VhaS6XHwk5q0TYt6vNogwo

To claim this, I am signing this object: