... code to view each step of the "next permutation" bit manipulation algorithm ...
This file contains hidden or 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 | |
| STORAGE_FILE="webpage.sum" | |
| init() { | |
| while [[ "$1" == -* ]]; do | |
| case "$1" in | |
| -s|--storage) | |
| STORAGE_FILE="$2" | |
| shift 2 |
Tema personalizzato per "www.dm.unipi.it"
- Il logo sta in una posizione più decente.
- Le scatole al centro non hanno bordo
#fff.
- Google Chrome / Chromium. Installare l'estensione Stylus per il browser, a quel punto andare su e premere sull'estensione e fare "Nuovo stile per" e selezionare tutto il sotto-dominio. A quel punto incollare il CSS di sopra e premere "Salva".
This file contains hidden or 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 { dirname, resolve } from 'path' | |
| import express from 'express' | |
| import { createServer as createViteServer } from 'vite' | |
| import { fileURLToPath } from 'url' | |
| const __dirname = dirname(fileURLToPath(import.meta.url)) | |
| const ROUTES = { | |
| '/': './index.html', | |
| '/buckets/:bucket': './[bucket].html', |
A simple function to handle a comunication over TCP via JSON using js generators.
Write a generator for each side of the conversation. To send or receive a message at some point just yield with one of the following functions
import { awaitMessage, sendMessage } from './mp.js'
This file contains hidden or 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
| 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';