Skip to content

Instantly share code, notes, and snippets.

View EtherTyper's full-sized avatar

ELI JOSEPH BRADLEY EtherTyper

  • Private Proxy
View GitHub Profile
@EtherTyper
EtherTyper / AAAAAA.zip
Created July 15, 2021 07:27 — forked from williambl/AAAAAA.zip
some shader packs for 21w10a
@EtherTyper
EtherTyper / npm.sh
Created July 15, 2021 07:17
Scripts for mass-downloading Font Awesome 5/6 packages.
#!/usr/bin/env bash
for i in $(cat packages.txt); do wget --recursive --user "" --password "$TOKEN" https://npm.fontawesome.com/$i; done
cat npm.fontawesome.com/@fortawesome/* | grep -o "https://.*.tgz" > tarballs.txt
for i in $(cat tarballs.txt); do wget -nc --user "" --password "$TOKEN" $i; done
@EtherTyper
EtherTyper / recover.sh
Created June 5, 2021 07:59
Recover Files from a Windows Image Backup
chflags -R nouchg .
readarray -t files <<< $(find . -type f)
for i in "${files[@]}"; do echo $i; mv "$i" "$(sed 's/ ([^()]*)$//g' <<< "$(sed 's/ ([^()]*)[.]/./g' <<< "$i")")"; done
@EtherTyper
EtherTyper / script.sh
Last active June 20, 2021 10:57
Reason Scraper
wget --recursive -e robots=off -nc --load-cookies $COOKIES --span-hosts --domains=reason.com,s3.amazonaws.com -I /digitaledition.reason.com/,/issue/,/archives/ https://reason.com/archives/
for i in s3.amazonaws.com/digitaledition.reason.com/*.pdf\?*;
do
if ! [ -L "$i" ]
then
mv $i "${i%%\?*}"
ln -s "$(basename ${i%%\?*})" $i
readlink $i
fi
done
@EtherTyper
EtherTyper / README.md
Created March 11, 2021 20:28
Voxatron Snippet advertising the Mozilla Humble Bundle, with minor updates so it works out of the box.

about:home Snippets

This repo contains code for standard and interactive snippets that we share on the about:home page in Firefox pre version 56.

License

Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/

@EtherTyper
EtherTyper / pdb.sh
Last active June 26, 2021 07:40
Download declassified President's Daily Briefs
for I in $(seq 0 124); do wget -nc "https://www.cia.gov/readingroom/collection/presidents-daily-brief-1961-1969?page=$I"; done
for I in $(seq 0 126); do wget -nc "https://www.cia.gov/readingroom/collection/presidents-daily-brief-1969-1977?page=$I"; done
cat presidents-daily-brief-* | grep -o "https://www.cia.gov/readingroom/docs/.*.pdf\"" | sed 's/.$//' > list.txt
wget -nc -i list.txt
#[allow(non_snake_case)]
mod Q {
use std::mem;
pub fn rsqrt(number: f32) -> f32 {
let x2 = number * 0.5;
let mut y = number;
let threehalfs = 1.5;
let mut i: i32 = unsafe { mem::transmute(y) };
@EtherTyper
EtherTyper / index.ts
Last active December 27, 2020 00:32
Array bivariance in TS strict mode
let a: number[] = [];
let b: (number | string)[] = a;
a[0] = 1;
b[1] = "lol";
console.log(a);
// $ tsc --strict index.ts
// $ node index.js
// [ 1, 'lol' ]
@EtherTyper
EtherTyper / update.sh
Created February 5, 2020 14:57
Updates all git repositories in a folder.
#!/usr/bin/env bash
for dir in $(dirname $0)/*
do
if test -d $dir && test -d $dir/.git
then
echo Updating $(basename $dir).
git -C $dir pull
fi
done
@EtherTyper
EtherTyper / README.md
Last active December 15, 2017 06:03
Vectors in Swift and type system experiments! For Eli Bradley's Computer Science Independent Study project.

Vectors in Swift

Why is this weakly typed?

The createVector method can return vectors of many arities, and therefore different types, in theory. These types cannot be inferred at compile time from the array of parameters the method is passed. So, when createVector delegates all but one of the dimensions it was given to another subvector, that subvector is given the compile-time type of Vectorish<Element>. Swift types are covariant by default, meaning in the following inheritance diagram: