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 / 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:
*
/*
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 / glitch.sh
Last active January 15, 2020 11:44
"Does anyone know how to use xrandr" glitch slides using ffmpeg. #lca2020
#!/bin/bash
# "Does anyone know how to use xrandr" glitch slides using ffmpeg. #lca2020
# Author: Michael Farrell <micolous+git@gmail.com>
# License: BSD-2-Clause or CC-0 (your choice).
#
######
#
# For linux.conf.au in Gold Coast, Ruan (@xfxf) asked me to make a simple "smoosh / defrag"
# slide that would be displayed as a holding slide between talks. I made some others with some
# AV team "in-jokes"... :)
@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",
@micolous
micolous / promotion.md
Last active September 21, 2019 03:32
Promoting personal GitHub repositories to an organisation

Promoting personal GitHub repositories to an organisation account

When a project gets big, it makes sense to "promote" the repository to an organisation account.

The nice thing about [transferring a repository][] is that GitHub automatically creates redirects for you.

But the problem is for the project's creator -- they should create their own fork of the repository to send pull requests. GitHub doesn't prompt you for a repository name, so this will remove all those redirects created earlier.

These instructions presume:

@micolous
micolous / README.md
Created July 6, 2019 01:33
Laser cut Xiaomi Mi Band 2 Charger

Laser cut Xiaomi Mi Band 2 Charger

This is a quick file to let you build a Xiaomi Mi Band 2 charger with a laser cutter.

The design is licensed CC-BY-SA 4.0.

Materials:

  • 60mm x 30mm of 3mm thick Plywood. You can use some other lasercuttable material, as long as it's at least 2mm thick.
  • 3x1 right angle pin header, with 2.54mm spacing