Skip to content

Instantly share code, notes, and snippets.

@davidgomesdev
davidgomesdev / chroot-to-pi.sh
Created May 25, 2024 10:02 — forked from htruong/chroot-to-pi.sh
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@davidgomesdev
davidgomesdev / scopes.csv
Last active September 7, 2022 21:02
blog-quarkus-guide-cdi-16
Annotation Description
ApplicationScoped One instance for the entire app
RequestScoped One instance per request
SessionScoped One instance per HTTP session
* Singleton One instance for the entire app
* Dependent Uses the same scope of the bean injecting it
@davidgomesdev
davidgomesdev / main.dart
Last active August 27, 2022 11:42
Isolate bidirectional communication example
import 'dart:isolate';
void main() async {
final recvPort = ReceivePort();
await Isolate.spawn<SendPort>((port) {
print('[2] received port');
final recvMsg = ReceivePort();
@davidgomesdev
davidgomesdev / retry.kt
Last active March 13, 2022 12:00
Kotlin Retry utils
// Inspired by `Flow.retry`
inline fun <T> retryUntil(
block: () -> T,
isValid: (T) -> Boolean,
beforeRetry: () -> Unit = {},
afterRetry: (T) -> Unit = {},
): T {
var value = block()
while (!isValid(value)) {