Skip to content

Instantly share code, notes, and snippets.

View juliyvchirkov's full-sized avatar
🇺🇦
old but not obsolete

Juliy V. Chirkov juliyvchirkov

🇺🇦
old but not obsolete
View GitHub Profile
@juliyvchirkov
juliyvchirkov / printsshconn.sh
Last active September 16, 2021 14:37
bash: collects and prints short summary on active ssh/sftp connections to server
#!/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
@juliyvchirkov
juliyvchirkov / typeOf.js
Last active November 30, 2022 15:33
javascript: identifies the exact type of an object or a primitive
/**
* 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
@juliyvchirkov
juliyvchirkov / validEmail.js
Last active March 12, 2021 06:27
javascript: strict e-mail address verification
/**
* 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'
@juliyvchirkov
juliyvchirkov / which.sh
Last active February 25, 2022 07:49
sh: mimics the core routine of GNU `which` command
#!/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