Skip to content

Instantly share code, notes, and snippets.

View Segmentational's full-sized avatar

Jacob B. Sanders Segmentational

  • Colorado, United States
  • 09:25 (UTC -06:00)
View GitHub Profile
@Segmentational
Segmentational / Dockerfile
Last active February 18, 2024 23:29
Optimized GO HTTP Server Dockerfile - Kubernetes, Private VCS Compatible
# syntax = docker/dockerfile:1.0-experimental
FROM golang:1.22-alpine as BUILD
# ARG NETRCPASSWORD
# ENV NETRCPASSWORD "${NETRCPASSWORD}"
# ENV GOPRIVATE "github.com/example/*"
ENV GOOS "linux"
ENV GOVCS "*:all"
@Segmentational
Segmentational / Security.Bash
Created August 2, 2023 20:12
Fedora, CentOS, Security Update Script
#!/bin/bash --posix
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.* -*- #
# See Bash Set-Options Reference Below
set -euo pipefail # (0)
set -o xtrace # (6)
@Segmentational
Segmentational / Template.Bash
Last active June 4, 2025 00:09
Default Bash Template
#!/bin/bash --posix
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.* -*- #
# Author: Jacob Sanders (GitHub - Segmentational)
# See Bash Set-Options Reference Below
@Segmentational
Segmentational / clean.bash
Created November 10, 2022 17:46
Node Directory + JS Clean-Up
find . -name "node_modules" -type "d" -exec "rm -rf {} || true" \;
find . -name "*.js" -type "f" -exec rm -f {} \;
find . -name "*.js.map" -type "f" -exec rm -f {} \;
find . -name "*.d.ts" -type "f" -exec rm -f {} \;
find . -name "*.ts.map" -type "f" -exec rm -f {} \;
find . -name "*.d.ts.map" -type "f" -exec rm -f {} \;
@Segmentational
Segmentational / walker.ts
Created October 5, 2022 04:58
Recursive Parent-Child Walker
import Cryptography from "crypto";
/***
* @example
* void (async () => {
* const parent = new Abstract("root");
*
* const child = new Abstract("child-1", parent);
*
* new Abstract("child-3", child);
@Segmentational
Segmentational / .npmrc
Last active September 13, 2022 21:09
Custom Workstation + GitLab `.npmrc` File
; For reference, every programming language's package-manager
; has a similar *.*rc (dot-rc) related setup (few exceptions
; include Go, C, etc.)
;
; Defaults := $ npm config ls --list
; -> $ npm config ls --json
fund = false
cache = ~/.npm
@Segmentational
Segmentational / socket.test.ts
Created September 9, 2022 11:17
Socket + TypeScript Functional Prototyping & Module Namespacing
import * as Network from "net";
/***
* @module Test
*
* **TSC Configuration**
*
* ```json
* {
* "compilerOptions": {
@Segmentational
Segmentational / index.ts
Last active August 30, 2022 08:04
Node CLI Argument Parsing
import Utility from "util";
process.argv = [...process.argv, "hello", "--debug", "--secrets-manager=local-azure-test", "another", "--key", "value", "--debug"];
class Arguable extends String {
position?: number;
original?: string;
constructor(value: string | Arguable) {
super(value);
@Segmentational
Segmentational / setup-prompt.ts
Last active September 13, 2022 23:16
Very Simple User-Input Prompt
/***
* Prompting Users for Input should be Easy...
*
* The following package is established with zero dependencies, and only
* uses the node.js standard library.
*
* As such, context should be kept to devDependencies, and should never
* be attempted to be used within a browser.
*
* Simply prompt the user for input at a given "key", and after a response,
@Segmentational
Segmentational / index.ts
Created August 2, 2022 04:16
Object Destructuring
import * as Mock from "@faker-js/faker";
function Generation() {
const { git } = Mock.faker;
const { address } = Mock.faker;
const { color } = Mock.faker;
const { company } = Mock.faker;
const { database } = Mock.faker;
const { hacker } = Mock.faker;
const { image } = Mock.faker;