Skip to content

Instantly share code, notes, and snippets.

View Segmentational's full-sized avatar

Jacob B. Sanders Segmentational

View GitHub Profile
@Segmentational
Segmentational / index.js
Last active November 19, 2021 11:14
Node.js OS System Check
import * as OS from "os";
import * as Process from "process";
const Platform = {
$: OS.platform(),
Name: null,
Valid: false
};
switch ( Platform.$ ) {
@Segmentational
Segmentational / .editorconfig
Last active July 12, 2022 17:51
.IDEA Webstorm Configuration
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 160
tab_width = 4
ij_continuation_indent_size = 8
ij_formatter_off_tag = @formatter:off
@Segmentational
Segmentational / npm-application.service
Last active October 29, 2021 19:40
`systemd` Unit File NPM Daemon Example
[Unit]
Description=[ ... ]
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
PIDFile=/run/npm-application.pid
WorkingDirectory=/usr/local/sbin/npm-application
ExecStartPre=/usr/local/bin/npm install .
ExecStart=/usr/local/bin/npm run start
@Segmentational
Segmentational / package.json
Last active November 3, 2021 20:15
Port Listener for Node.js `package.json` Script Sections
{
"scripts": {
"process": "lsof -nP -iTCP -sTCP:LISTEN | grep 8443 | awk '{ print $2 }' | head -1"
}
}
@Segmentational
Segmentational / index.js
Last active November 4, 2021 23:02
AWS Secrets Manager Node.JS Interfacing
import AWS from "aws-sdk";
const Region = "us-east-2";
const Secret = (process.env.NODE_ENV === "production")
? "[Organization]/[Environment]/Credentials/[Application]/[Service]/[Extension]"
: "[Organization]/[Environment]/Credentials/[Application]/[Service]/[Extension]"
// Create a Secrets Manager Client
const Client = new AWS.SecretsManager({
@Segmentational
Segmentational / example.bash
Created November 5, 2021 01:27
Docker `run` Syntax
docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]
@Segmentational
Segmentational / .nanorc
Last active November 7, 2021 00:12
Nano Color Schema
# ~/.nanorc
include "/usr/local/share/nano/*.nanorc"
magic #!\/bin\/bash
io@IO-Development ~ % cat /usr/local/share/nano/*.nanorc
## Syntax highlighting for assembler.
syntax asm "\.(S|s|asm)$"
@Segmentational
Segmentational / index.js
Last active November 9, 2021 06:59
JSDoc Module Top-Level Template
/***
* @name .....
*
* @module Module
* @version 0.0.1 (Documentation)
* @summary .....
*
* @author Jacob B. Sanders
* @license BSD 3-Clause License
* @copyright Cloud-Technology LLC. & Affiliates.
@Segmentational
Segmentational / index.js
Last active November 19, 2021 11:48
ESM Module, Local File Usage - import.meta.url
import FS from "fs";
import Path from "path";
import * as URI from "url";
import Process from "process";
const CWD = Process.cwd();
const $ = {
Debug: Process.argv.splice(2).indexOf("--debug") !== -1