Skip to content

Instantly share code, notes, and snippets.

View NotTimTam's full-sized avatar
⌨️
Building JavaScript tools...

Tim Phillips NotTimTam

⌨️
Building JavaScript tools...
View GitHub Profile
@NotTimTam
NotTimTam / console.js
Last active April 19, 2024 06:14
Tiny dependency-less package for detailed console logs.
/**
* Console color reference.
*/
export const colorReference = {
Reset: "\x1b[0m",
Bright: "\x1b[1m",
Dim: "\x1b[2m",
Underscore: "\x1b[4m",
Blink: "\x1b[5m",
Reverse: "\x1b[7m",
@NotTimTam
NotTimTam / build_cli.js
Last active June 21, 2023 20:42
Build a command line interface using a commander program.
/**
* Builds commands and options for a Commander.js program object using an array of command objects.
* @param {Object[]} commands - An array of command objects, where each object represents a command with its options.
* @param {string} commands.name - The name of the command.
* @param {string} commands.description - The description of the command.
* @param {Object[]} commands.options - An array of option objects for the command.
* @param {string} commands.options.flags - The flags for the option.
* @param {string} commands.options.description - The description of the option.
* @param {function} commands.action - The action function for the command.
*/
@NotTimTam
NotTimTam / repo-paths.json
Created June 14, 2023 21:13
A list of the API repository paths on common Git platforms.
{
"github": "https://api.github.com/repos/:owner/:repo",
"gitlab": "https://gitlab.com/api/v4/projects/:repo",
"bitbucket": "https://api.bitbucket.org/2.0/repositories/:owner/:repo",
"azuredevops": "https://dev.azure.com/:owner/repositories/:repo",
}
@NotTimTam
NotTimTam / mail.js
Last active March 24, 2023 17:06
Uses nodemailer-mailgun-transport and nodemailer to send emails through mailgun's SMTP tools.
/**
* mail.js
* 2023-03-24
* Timothy Phillips
*/
const nodemailer = require("nodemailer");
const mg = require("nodemailer-mailgun-transport");
const MAILGUN_USERNAME = process.env.MAILGUN_USERNAME;
const domain = process.env.MAILGUN_DOMAIN;