Skip to content

Instantly share code, notes, and snippets.

View micolous's full-sized avatar
💭
I may be slow to respond.

micolous micolous

💭
I may be slow to respond.
View GitHub Profile
@micolous
micolous / main.rs
Created November 6, 2023 07:42
binrw seeking issues
/*
https://github.com/jam1garner/binrw/issues/235
[dependencies]
binrw = "0.13.1"
hex = "0.4.3"
sha2 = "0.10.8"
## OUTPUT
@micolous
micolous / gocard.py
Last active September 12, 2023 14:16
Requires mfoc dump in mfc format (1 kilobyte)
import argparse, struct, base64, datetime
MODES = {
1: 'Value-add machine',
4: 'Bus',
5: 'Train',
18: 'Ferry',
}
STATIONS = {
@micolous
micolous / gist:753c172bb23af8a13f99f7677a7e79de
Created September 18, 2022 09:03
Yubikey Security Key C NFC trace with webauthn-rs
% RUST_LOG=trace cargo run --example nfc_token_info --features nfc
Running `~/webauthn-rs/target/debug/examples/nfc_token_info`
2022-09-18T09:02:32.931534Z INFO webauthn_authenticator_rs::nfc: Using reader: "ACS ACR122U"
2022-09-18T09:02:32.931588Z INFO nfc_token_info::core: Using reader: NFCReader { reader_id: "ACS ACR122U" }
2022-09-18T09:02:32.933665Z TRACE webauthn_authenticator_rs::nfc: rdr_state: CHANGED | EMPTY
2022-09-18T09:02:32.933690Z INFO webauthn_authenticator_rs::nfc: Card removed
2022-09-18T09:02:39.505864Z TRACE webauthn_authenticator_rs::nfc: rdr_state: CHANGED | PRESENT
2022-09-18T09:02:39.508551Z TRACE webauthn_authenticator_rs::nfc: ATR: [3b, 8d, 80, 01, 80, 73, c0, 21, c0, 57, 59, 75, 62, 69, 4b, 65, 79, f9]
2022-09-18T09:02:39.508662Z TRACE webauthn_authenticator_rs::nfc: Parsed: Atr { protocols: [0, 1], t1: [128, 115, 192, 33, 192, 87, 89, 117, 98, 105, 75, 101, 121], storage_card: false, card_issuers_data: Some([89, 117, 98, 105, 75, 101, 121]), c
@micolous
micolous / flappy.js
Last active July 23, 2022 02:29
Flappy Birb (for Last Call BBS)
"use strict";
/**
* @file Flappy Birb (for Last Call BBS)
* @version 1.2
* @copyright 2022 Michael Farrell
* @author Michael Farrell <micolous+git@gmail.com>
* @license Apache-2.0
*
* Changes:
*
@micolous
micolous / github-delete-all-notifications.user.js
Created September 26, 2011 05:10
GitHub: delete all notifications button
// ==UserScript==
// @name GitHub delete all notifications button
// @namespace http://www.github.com/micolous/delete-all-notifications
// @description Adds a button to allow you to delete all notifications on a page.
// @include http://github.com/inbox/notifications*
// @include https://github.com/inbox/notifications*
// ==/UserScript==
/*
@micolous
micolous / build.gradle.kts
Created October 28, 2019 08:47
run pkgConfig in gradle config for Kotlin/Native
/**
* Runs `pkg-config`:
* https://github.com/JetBrains/kotlin-native/issues/1534#issuecomment-384894431
*/
fun runPkgConfig(
vararg packageNames: String,
cflags: Boolean = false,
libs: Boolean = false): List<String> {
val p = ProcessBuilder(*(listOfNotNull(
"pkg-config",
/*
Input Pull-up Serial + Debounce
This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a digital
input on pin 2 and prints the results to the Serial Monitor.
The circuit:
- momentary switch attached from pin 2 to ground
- built-in LED on pin 13
@micolous
micolous / discord-midi-ptt.user.js
Created December 21, 2020 03:44
MIDI-controlled PTT in Discord
// ==UserScript==
// @name Discord: MIDI controlled PTT
// @version 1
// @grant none
// @match https://discord.com/*
// ==/UserScript==
/*
* This listens for any MIDI device sending a "note on" or "note off" event,
* and rebinds this to F9.
// ==UserScript==
// @name Streamyard: Keyboard Shortcuts
// @version 1.0
// @grant none
// @match https://streamyard.com/*
// ==/UserScript==
//
// Copyright 2020 Michael Farrell <micolous+git@gmail.com>
//
// Redistribution and use in source and binary forms, with or without
@micolous
micolous / tfnsw_api.json
Created April 24, 2016 15:35
Swagger API for the Transport for NSW Open Data portal.
{
"info": {
"version": "1.0",
"license": {
"url": "https://creativecommons.org/licenses/by/4.0/legalcode",
"name": "CC-BY-4.0"
},
"title": "Transport for NSW Open Data API"
},
"paths": {