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 | |
# Check if an argument is provided | |
if [[ -z "$1" ]]; then | |
echo "Usage: $0 <forwarded-key-identifier> [ssh-arguments...]" | |
exit 1 | |
fi | |
# Extract and remove the first argument (forwarded key identifier) | |
forwarded_key_identifier="$1" |
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 | |
## parallel.bash | |
## ------------- | |
## A bash script that executes provided tasks in parallel, with added handling | |
## for errors, logs, and signals (within reason). | |
## ```sh | |
## ./parallel.bash -m 2 \ | |
## 'echo 'sleeping1'; sleep 5' \ | |
## 'echo 'sleeping3'; sleep 2' \ | |
## 'echo 'sleeping3'; sleep 3' \ |
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 type { ChildProcess, ChildProcessByStdio } from 'node:child_process'; | |
import type { Readable, Writable } from 'node:stream'; | |
import stripAnsi from 'npm:strip-ansi'; | |
export enum Phase { | |
Stopped = 'stopped', | |
Stopping = 'stopping', | |
Starting = 'starting', | |
Started = 'started', | |
} |
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
## | |
## Source in Xcode Run Script Phase | |
## | |
set -e | |
CARTHAGE=$(command -v carthage) | |
## | |
## Validate |
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
/** | |
* The Monty Hall Problem | |
* https://en.wikipedia.org/wiki/Monty_Hall_problem | |
*/ | |
// convert 0.333 to 33% | |
const toPercentInteger = (fraction) => { | |
return Math.floor(fraction * 100); | |
}; |
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
/** | |
* This object represents a single listener of a Singal. | |
* A listener is simply an object with a reference to a function and thisArg, | |
* with a priority for insertion sorting and a once flag. | |
* @class | |
*/ | |
class Listener { | |
/** | |
* @param {Function} fn - The listener function | |
* @param {Function} [thisArg] - The listener thisArg |
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/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |
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 | |
list="" | |
otool_list() { | |
local lib="$1" | |
local libs="" | |
if [[ "$list" == "${list/:$lib/}" ]]; then | |
echo "$lib" | |
list="$list:$lib" |
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
## Needed for CI environment | |
export NEKOPATH="" | |
export HAXEPATH="" | |
export HAXE_STD_PATH="" | |
DIST="/path/to/dist" | |
rm -fR $DIST | |
SAMPLES=$(lime create openfl | sed -nr 's/ - (.+)/\1/p') | |
for sample in $SAMPLES |
NewerOlder