Extended implementation of world known common shell function, fully POSIX
compliant
The project has been significantly improved and moved to the new permanent location github.com/juliyvchirkov/sh.yesnoprompt
Extended implementation of world known common shell function, fully POSIX
compliant
The project has been significantly improved and moved to the new permanent location github.com/juliyvchirkov/sh.yesnoprompt
## | |
# long option format: --option=value | |
# | |
# usage: value="$(getOptionValue option "${@}")" | |
# script.sh --pidfile=/run/pidfile.pid ➙ pidfile="$(getOptionValue pidfile "${@}")" | |
## | |
getOptionValue() { | |
local option |
#!/usr/bin/env bash | |
# Copyright Atomicorp 2020 | |
# AGPL 3.0 | |
# Modified by Juliy V. Chirkov juliyvchirkov@gmail.com https://juliyvchirkov.github.io/ 12/07/2021 | |
# Globals | |
VERSION=0.2 | |
OSSEC_HOME=/var/ossec | |
SERVER=updates.atomicorp.com |
Note
Work on routine update and annotation in progress
<?php declare(strict_types = 1); | |
/** | |
* Provides polyfills of string functions str_starts_with, str_contains and str_ends_with, | |
* core functions since PHP 8, along with their multibyte implementations mb_str_starts_with, | |
* mb_str_contains and mb_str_ends_with | |
* | |
* Covers PHP 4 - PHP 7, safe to utilize with PHP 8 | |
*/ | |
/** |
import { realpathSync, existsSync } from 'node:fs' | |
import { basename, dirname } from 'node:path' | |
export default (() => { | |
let mageRoot = dirname(realpathSync(import.meta.url.slice(7))) | |
while (!(existsSync(`${ mageRoot }/app/Mage.php`) || existsSync(`${ mageRoot }/bin/magento`))) { | |
if (mageRoot === '/') { | |
throw new Error(`${ basename(import.meta.url.slice(7)) } should be placed inside Magento project tree`) | |
} |
#!/usr/bin/env bash | |
# | |
# If one is missing the original *__git_ps1* function from @git/git package, this wrapper can be utilized as | |
# temporary solution. Just like the original, it prints current branch name like *main*, *dev* etc. or tags | |
# like *v1.4.0*, or nothing, if current directory is outside of any git tree | |
# | |
# @see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
# | |
# Significantly updated 06/18/2022 | |
# |
#!/usr/bin/env bash | |
# | |
# Terminal truecolor test | |
# Proof of concept, completely made of pure bash builtins | |
# | |
# Accepts an integer from 14 up to infinity to set the length of test snake | |
# By default the snake is 88 symbols long | |
# | |
# Execute or source termTestTruecolor.sh to export function | |
# |
#!/usr/bin/env bash | |
# | |
# Provides shortcuts for apt options | |
# | |
# @see https://gist.github.com/juliyvchirkov/7ee6591b9744c36fa9ab73a1ca2ef544#file-quickinstall-rst | |
case ${1} in | |
i) | |
arg1st="install" ;; | |
ri) |
#!/bin/bash | |
# | |
# Enable nopasswd mode for sudo on macOS from the userspace in fast and totally non-interactive way | |
# | |
# Type the password last time to apply the new mode and forget it for any console task for ages | |
# Use the rollback to restore password protection | |
# | |
# Developed and tested by https://juliyvchirkov.github.io/ under the MIT license on macOS Big Sur 11.2.0 | |
# | |
# Get latest version at https://gist.github.com/juliyvchirkov/3ca76582ed6b6a8366c9e7d60644960d |