This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Colors | |
START=$(tput setaf 4) | |
SUCCESS=$(tput setaf 2) | |
WARNING=$(tput setaf 3) | |
ERROR=$(tput setaf 1) | |
INFO=$(tput setaf 6) | |
RESET=$(tput sgr0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:isolate'; | |
void main() async { | |
final recvPort = ReceivePort(); | |
await Isolate.spawn<SendPort>((port) { | |
print('[2] received port'); | |
final recvMsg = ReceivePort(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)) { |