As in the title
async function fakeProvider(onData) {
onData('line 1');
onData('line 2');| package extract_test | |
| import ( | |
| "regexp" | |
| "strings" | |
| "testing" | |
| ) | |
| func lines(source string) chan string { | |
| output := make(chan string) |
Run a function for every line in a file following its output. This is just a more modern version of the code found at https://stackoverflow.com/questions/11225001/reading-a-file-in-real-time-using-node-js and only uses open from fs/promises.
Just pass a callback that consumes the lines of the followed file.
import tail from './tail.js';Pseudocode inspiration from: https://people.eecs.berkeley.edu/~kubitron/courses/cs162-F10/hand-outs/synch.html
ThreadQueue() {
var queue: Queue<Thread>;Launch commands in a new detached tmux session. This needs tmux and sqlite3 to be installed, see launch --help for usage.
Sqlite is used for storing the command history in ~/.cache/aziis98.scripts.launch/history.db that can be run with launch past <SESSION_NAME>.
I tried to use a bare git repo to version my dotfiles and my config files but I ended not liking it very much (I don't like to mess so much with the git working directory).
This is my first try on a custom setup, the local copies of the "scripts" and "dotfiles" repositories can be stored wherever on the system and this two command automatically linkup all the files to their target location using a custom comment format in the script files.
The following script automatically symlinks all scripts to the correct directories with a declaration like
| const apiResponse1 = { | |
| post: "Questa è la domanda di questo thread", | |
| votes: 1, | |
| timestamp: "un po' di fantasia", | |
| children: [ | |
| { | |
| content: "Questa è la prima riposta", | |
| votes: 1, | |
| timestamp: "un po' di fantasia", | |
| children: [] |