Skip to content

Instantly share code, notes, and snippets.

View william-reed's full-sized avatar
😂
eating oatmeal

william-reed

😂
eating oatmeal
View GitHub Profile
@william-reed
william-reed / erwin.js
Created March 2, 2022 01:20
erwin.vw.com download all documents
// once you have a one day plan:
// 1. navigate to your vehicles page under 'Service Information'
// 2. Leave 'Category 1' set to '[Category 1]' and click search
// 3. Open your JS console
// get all document titles
titles = document.getElementsByClassName("title")
documentIds = []
// extract each document id
@william-reed
william-reed / NavigateSafe.kt
Created May 4, 2020 13:00
prevent “… is unknown to this NavController” caused by double navigation
import android.os.Bundle
import androidx.annotation.IdRes
import androidx.navigation.NavController
import androidx.navigation.NavDirections
import com.busright.watchdog.BuildConfig
import timber.log.Timber
import java.lang.IllegalArgumentException
/**
* This file represents attempts to make my errors in navigation safer.
JAVA_VERSION=$(java -version 2>&1 | awk 'NR==1{ gsub(/"/,""); print $3 }' | cut -f1 -d".")
@william-reed
william-reed / edid-reader.c
Last active February 16, 2019 16:29
reading EDID information on OSX
###############################
## main.c
###############################
#include <ApplicationServices/ApplicationServices.h>
#include <IOKit/graphics/IOGraphicsLib.h>
const UInt8 SERIAL = 0xFF;
const UInt8 DISPLAY_NAME = 0xFC;
const UInt8 UNSPECIFIED_TEXT = 0xFE;
@william-reed
william-reed / InstantTaskExecutor.kt
Created December 12, 2018 02:39
JUnit 5 executor version of InstantTaskExecutorRule
import androidx.arch.core.executor.ArchTaskExecutor
import androidx.arch.core.executor.TaskExecutor
import org.junit.jupiter.api.extension.ExtensionContext
import org.junit.jupiter.api.extension.TestInstancePostProcessor
class InstantTaskExecutor : TestInstancePostProcessor {
override fun postProcessTestInstance(testInstance: Any?, context: ExtensionContext?) {
ArchTaskExecutor.getInstance().setDelegate(object : TaskExecutor() {
override fun executeOnDiskIO(runnable: Runnable) {
runnable.run()
package io.github.wreed12345;
import java.util.ArrayList;
import java.util.List;
import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;
import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.packet.PcapPacketHandler;
import org.jnetpcap.protocol.tcpip.Tcp;