Skip to content

Instantly share code, notes, and snippets.

View itg-dave's full-sized avatar

David Pache itg-dave

View GitHub Profile
@a1xon
a1xon / AsyncQueueManager.js
Created December 18, 2021 07:03
Queue Manager to handle n async requests
const EventEmitter = require('events');
const { randomUUID } = require('crypto');
class AsyncQueueManager {
constructor(maxSimultaneousCalls = 1) {
this.maxSimultaneousCalls = maxSimultaneousCalls;
this.currentSimultaneousCalls = 0;
this.queue = [];
this.eventEmitter = new EventEmitter();
}
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@SethCalkins
SethCalkins / LittleSnitch_Block_List.md
Last active January 5, 2023 05:17
Little Snitch Script to block Ad Servers

Here is a script to take the hosts from From http://pgl.yoyo.org/adservers/ and convert them to rules for Little Snitch.

It has options to grab the entire list or grab new entries past a certain date.

Just grab the output and copy/paste into Little Snitch.

The script is written to block access to any process, any port. You can also delete those lines and it will only block Mail. Or use the options to enter any process, port or protocol you want to block.