Skip to content

Instantly share code, notes, and snippets.

View aaronjanse's full-sized avatar

Aaron Janse aaronjanse

  • Berkeley, CA
View GitHub Profile
@aaronjanse
aaronjanse / burschcleaner.user.js
Last active September 27, 2016 22:20
Bursch Blog Cleaner
// ==UserScript==
// @name Bursch Blog Cleaner
// @version 1.0
// @description This makes Mr.Bursch's blog legible!
// @author Aaron Janse
// @match http://mrbursch.blogspot.com/*
// @grant none
// ==/UserScript==
(function() {
@aaronjanse
aaronjanse / README.md
Last active October 14, 2017 19:02
A simple command to check how many commits have not been pushed/pulled

Shows how many commits ahead and behind git remotes are.

How to run:

bash remote_status.sh [remote]

The remote defaults to origin

(optional) Installation:

Keybase proof

I hereby claim:

  • I am aaronduino on github.
  • I am aaronjanse (https://keybase.io/aaronjanse) on keybase.
  • I have a public key ASBem7Vx9_aAoQlepr-BE9ehqPKTg6Lea5cFPrzSCg39-go

To claim this, I am signing this object:

@aaronjanse
aaronjanse / anglediff.js
Created June 20, 2016 21:42
find the smallest distance between two angles
// from http://stackoverflow.com/a/7869457
// converted to js code
// x and y are the angles in radians
function getDifference(x, y) {
var a = x-y;
a = (function(i, j) {return i-Math.floor(i/j)*j})(a+Math.PI, Math.PI*2); // (a+180) % 360; this ensures the correct sign
a -= Math.PI;
return a;
}
@aaronjanse
aaronjanse / README.md
Created April 30, 2018 17:43
Arch Linux - resize root partition
@aaronjanse
aaronjanse / README.md
Created April 30, 2018 21:09
Resize Arch Linux display

Look for the name in your display (e.g. VGA-1) and possible resolutions (e.g. 1280x768) in

xrandr -q | head

And resize your display like so:

xrandr --display :0 --output NAME_OF_YOUR_DISPLAY --mode WIDTHxHEIGHT
@aaronjanse
aaronjanse / README.md
Created May 18, 2018 23:32
RISC-V 32-bit machine code breakdown
31        26        21        16        11   9     6           0
vv        vv        vv        vv        vv  vv    vv          vv
'F'E'D'C'B'A'9'8'7'6'5'4'3'2'1'0 F E D C B A 9 8 7 6 5 4 3 2 1 0
[ jump target                                  25][ opcode    7]  J-type
[ rd    5][ upper immediate                    19][ opcode    7]  U-type
[ rd    5][ rs1   5][ immhi 5][ immlo     7][fun3][ opcode    7]  I-type
[ immhi 5][ rs1   5][ rs2   5][ immlo     7][fun3][ opcode    7]  B-type
[ rd    5][ rs1   5][ rs2   5][ funct          10][ opcode    7]  R-type
[ rd 5][ rs1 5][ rs2 5][ rs3 5][ funct 5][ opcode 7] R4-type
@aaronjanse
aaronjanse / shamir.go
Last active May 31, 2018 03:30
An easy way to do shamir secret sharing from the command line
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"
sssa "github.com/SSSAAS/sssa-golang"
@aaronjanse
aaronjanse / default.nix
Created July 20, 2020 23:21
Broken `relibc`, compiled using Nix
{ stdenv, buildPackages, fetchurl, lib , makeRustPlatform }:
let
rpath = lib.makeLibraryPath [
buildPackages.stdenv.cc.libc
"$out"
];
bootstrapCrossRust = stdenv.mkDerivation {
name = "binary-redox-rust";
@aaronjanse
aaronjanse / energia.nix
Created November 4, 2020 01:52
Works with nixos-unstable as of October 2020
{ stdenv, autoPatchelfHook, ffmpeg_3, fetchurl, bash, jdk, kmod, pkgs }:
stdenv.mkDerivation {
name = "energia";
version = "1.8.10E23";
src = fetchurl {
url = "http://energia.nu/downloads/downloadv4.php?file=energia-1.8.10E23-linux64.tar.xz";
sha256 = "065vii9x9b7x4bj1b97grz2vwd4xam1lprsbgsfagry3adf3bshv";
};