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 node | |
(async () => { | |
const response = await fetch("http://localhost:3000/api/ping"); | |
const result = await response.text(); | |
if (!response.ok) { | |
throw new Error(`Healthcheck failed: ${response.status}`); | |
} else if (result !== "pong") { | |
throw new Error(`Healthcheck failed: ${result} !== pong`); |
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 function sums the given numbers. | |
* | |
* @param xs - The array to be calculated | |
* @returns The sum of all elements in the number array | |
* | |
* @example | |
* ```typescript | |
* sum(); // 0 | |
* sum([1, 2, 3]); // 6 |
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 function returns a sequence of numbers. | |
* | |
* @param length - The length of the array to create | |
* @returns An array of numbers from 0 to `length` - 1 | |
* | |
* @example | |
* ```typescript | |
* range(0); // [] | |
* range(5); // [0, 1, 2, 3, 4] |
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 function checks if the given value is empty. | |
* | |
* @param input - Any data structure that may be empty | |
* @returns if the `input` is empty | |
* | |
* @example | |
* ```typescript | |
* isEmpty(""); // true | |
* isEmpty([]); // true |
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
/** | |
* Functional wrapper for try…catch… | |
* | |
* @param tryer - The function that may throw. | |
* @param catcher - The function that will be evaluated if `tryer` throws. | |
* @typeParam P - The type of the parameter of tryer; if throw, it will be passed to catcher. | |
* @typeParam T - The return type of tryer. | |
* @typeParam C - The return type of catcher. | |
* @returns A new function that will catch exceptions and send them to the catcher. | |
* |
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
tap "homebrew/bundle" | |
tap "homebrew/core" |
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
# | |
# ~/.bash_aliases | |
# | |
# User alias | |
alias cls='clear' | |
alias now='date +"%T"' | |
alias nowdate='date +"%d-%m-%Y"' | |
alias nowtime='now' | |
alias path='echo -e ${PATH//:/\\n}' |
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
# | |
# ~/.bashrc | |
# | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) | |
HISTSIZE=1000 | |
HISTFILESIZE=2000 |
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
#================================================================= | |
# https://gist.github.com/Mogeko/64a20bc441cb43a7b26e416270c10168 | |
# https://github.com/P3TERX/aria2.conf (upstream) | |
# File name:aria2.conf | |
# Description: Aria2 config file | |
# Lisence: MIT | |
# Author: Mogeko, P3TERX | |
# Blog: https://p3terx.com for P3TERX | |
# https://mogeko.me for Mogeko | |
#================================================================= |
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
tap "homebrew/bundle" | |
tap "homebrew/core" | |
# Macro processing language | |
brew "m4" | |
# Bourne-Again SHell, a UNIX command interpreter | |
brew "bash" | |
# GNU binary tools for native development | |
brew "binutils" | |
# GNU File, Shell, and Text utilities | |
brew "coreutils" |
NewerOlder