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
/** | |
* Provides strict e-mail address verification | |
* Includes support for unicode | |
* | |
* @param string e-mail address to verify | |
* @return boolean true if e-mail address is valid, false otherwise | |
*/ | |
function validEmail (email) { | |
'use strict' |
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 | |
# | |
# 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 | |
# |
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 | |
# | |
# Designed by https://juliyvchirkov.github.io under MIT license | |
# | |
# Collects and prints short summary on active ssh/sftp connections to server | |
# | |
# SSH/SFTP connections | |
# ---------------------------------- | |
# (3) 14.88.18.1 | |
# (1) 14.88.18.8 |
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 | |
# 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 |
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 sh | |
# | |
# Mimics the core routine of UNIX `which` command[1] | |
# | |
# Implemented on the top of shell builtins to provide the way | |
# to resolve external dependencies (commands) for shell scripts | |
# whether external `which` command available or not | |
# | |
# Designed to be fully `sh` compatible, strictly honors POSIX standards | |
# and completely meets Shell Command Language specification[2], thus |
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 | |
# | |
# Provides shortcuts for apt options | |
# | |
# @see https://gist.github.com/juliyvchirkov/7ee6591b9744c36fa9ab73a1ca2ef544#file-quickinstall-rst | |
case ${1} in | |
i) | |
arg1st="install" ;; | |
ri) |
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 | |
# | |
# 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 | |
# |
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 { 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`) | |
} |
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
## | |
# long option format: --option=value | |
# | |
# usage: value="$(getOptionValue option "${@}")" | |
# script.sh --pidfile=/run/pidfile.pid ➙ pidfile="$(getOptionValue pidfile "${@}")" | |
## | |
getOptionValue() { | |
local option |
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
/** | |
* Returns a string indicating the type of an object or a primitive | |
* Throws if invoked w/o arguments | |
* | |
* @param {any} An object or a primitive whose type is to be determined | |
* @return {string} The type of probed item | |
* | |
* Unlike native typeof operator identifies Null as is, not as Object | |
* Delivers the exact type of an item not limited to 9 basic types Undefined, | |
* Null, Boolean, Number, BigInt, String, Function, Symbol and Object |
OlderNewer