Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Upcoming availability for work.

Ron Evans deadprogram

💭
Upcoming availability for work.
View GitHub Profile
@deadprogram
deadprogram / go-uf2.go
Last active April 7, 2024 03:38
Converts a .BIN firmware file to a .UF2 file
// Converts firmware files from BIN to UF2 format before flashing.
//
// For more information about the UF2 firmware file format, please see:
// https://github.com/Microsoft/uf2
//
package main
import (
"fmt"
"io/ioutil"
// NOT true random number generation on RP2040 but good enough for quick demos.
// Do not use in important production systems.
// Seriously, don't.
package main
import (
"machine"
"crypto/rand"
)
@deadprogram
deadprogram / showmac.go
Created September 10, 2022 10:20
This example shows the MAC address on boards with WiFiNINA support
package main
import (
"machine"
"strconv"
"time"
"tinygo.org/x/drivers/wifinina"
)
package main
import (
"machine"
"machine/usb/hid"
"machine/usb/hid/keyboard"
"time"
)
// NUCLEO-L432KC
// GND to GND
// SCL to D5
// SDA to D4
package main
import (
"fmt"
"machine"
"time"
@deadprogram
deadprogram / sastoken.go
Last active December 19, 2021 16:43
Golang command line utility to generate Microsoft Azure SAS tokens for Azure IoT Hub
// Golang command line utility to generate an Microsoft Azure SAS token for use
// with the MS Azure IoT Hub.
//
// USAGE: USAGE: sastoken <URI> <key> <expiresInMins> [policy]
//
// Copyright © 2016 The Hybrid Group (http://hybridgroup.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the “Software”), to deal
// in the Software without restriction, including without limitation the rights
@deadprogram
deadprogram / example_i2c_peripheral.go
Last active November 22, 2021 13:55
Concept for i2c peripheral (target) interface
package main
import (
"machine"
"time"
)
var input [16]byte
func main() {
@deadprogram
deadprogram / quotes-about-software.md
Last active September 3, 2021 09:48
Quotes about software

"Adding manpower to a late software project, makes it later." - Frederick P. Brooks Jr., The Mythical Man-Month: Essays on Software Engineering

"Learning is limited by an organization’s ability to keep its people." - Tom DeMarco

"A primary cause of complexity is that software vendors uncritically adopt almost any feature that users want." - Niklaus Wirth

"When executives ask for an 'estimate,' they’re often asking for a commitment or for a plan to meet a target." - Steve McConnell, Software Estimation: Demystifying the Black Art

"Time pressure gradually corrupts an engineer's standard of quality and perfection. It has a detrimental effect on people as well as products." - Niklaus Wirth

// go run demo/style-transfer/main.go 1 data/starry_night.t7 opencv fp32
//
package main
import (
"fmt"
"image"
"os"
"gocv.io/x/gocv"
xxd 100000 512
00100000: eb 58 90 6d 6b 66 73 2e 66 61 74 00 02 10 20 00 .X.mkfs.fat... .
00100010: 02 00 00 00 00 f8 00 00 10 00 04 00 00 08 00 00 ................
00100020: 00 70 df 01 e0 3b 00 00 00 00 00 00 02 00 00 00 .p...;..........
00100030: 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00100040: 80 00 29 f1 32 21 be 4e 4f 20 4e 41 4d 45 20 20 ..).2!.NO NAME
00100050: 20 20 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac FAT32 ...w|.
00100060: 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 ".t.V.......^..2
00100070: e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e .......This is n
00100080: 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69 ot a bootable di