Skip to content

Instantly share code, notes, and snippets.

View floitsch's full-sized avatar

Florian Loitsch floitsch

View GitHub Profile
@floitsch
floitsch / action.yml
Created September 20, 2024 09:27
Correct usage of boolean flags in GitHub actions
# Use 'inputs.<name>' when pasting into a bash `if`, like so:
# if [[ "${{ inputs.strip }}" == 'true' ]]; then ...
#
# When using to guard a step, use 'github.event.inputs.<name>', like so:
# if: ${{ github.event.inputs.<name> == 'true' }}
# or
# if: ${{ github.event.inputs.<name> != 'false' }}
# In the first case, the step will not run if there isn't any workflow dispatch.
# In the second case, the step will run if there isn't any workflow dispatch.
# As such, the recommendation is to use the `== true` if the default is
@floitsch
floitsch / listen.sh
Created June 20, 2024 19:37
Listen to ttyACM0 as soon as it appears.
inotifywait -e create --include ttyACM0 /dev && \
ls -l /dev/ttyACM0 && \
inotifywait -e attrib /dev --include ttyACM0 && \
jag monitor --port /dev/ttyACM0 -a --envelope esp32s3-cdc
import net
import net.wifi
CREDENTIALS ::= [
[ "ssid1", "password" ],
[ "ssid2", "password" ]
]
attempt-connection [block] -> bool:
network/net.Interface? := null
@floitsch
floitsch / broadcaster.toit
Created January 29, 2023 02:48
Example for how to use UDP broadcast to communicate between devices.
/*
Zero-Clause BSD License
Copyright (C) 2023 Toitware ApS
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND