Skip to content

Instantly share code, notes, and snippets.

View twaldecker's full-sized avatar

Thomas Waldecker twaldecker

  • Starnberg, Germany
View GitHub Profile
@lilianmallardeau
lilianmallardeau / raspi-reset
Created October 30, 2023 00:47
raspi-reset
#!/bin/bash
BS=64M
DISK_ID=0x7788c428
ROOT_DEV=/dev/mmcblk0
BOOTFS_BACKUP=${ROOT_DEV}p3
BOOTFS_TARGET=${ROOT_DEV}p1
ROOTFS_BACKUP=${ROOT_DEV}p2
ROOTFS_TARGET=${ROOT_DEV}p4
if [ $EUID -ne 0 ]; then
@Aaronius
Aaronius / sequence.js
Last active September 15, 2017 11:54
Promise-based Sequential Queue
// Queues multiple asynchronous processes to run sequentially via promises
// Process can be added to the queue while other processes are running
var Sequence = function() {};
Sequence.prototype.enqueue = function(fn) {
this.tail = this.tail ? this.tail.finally(fn) : fn();
};
// Usage