Skip to content

Instantly share code, notes, and snippets.

View joewright's full-sized avatar
🕶️
🤳 🌭

Joe Wright joewright

🕶️
🤳 🌭
View GitHub Profile
declare var process: {
env: {}
}
class EnvironmentConfig {
name: string
required_variable: string
optional_variable: string | undefined
constructor(env: any) {
@joewright
joewright / environment.py
Last active April 8, 2025 20:44
environment pattern
import os
class EnvironmentConfiguration():
def __init__(cls):
cls.name = os.environ.get('ENV_NAME', 'development')
cls.required_variable = os.environ.get('REQUIRED_VARIABLE')
cls.some_integer = int(os.environ.get('COOLNESS_LEVEL'))
cls.some_array = str(os.environ.get('GREAT_IDEAS')).split(',')
# Config generated by Ghostty Config https://ghostty.zerebos.com/app/import-export
term = xterm-256color
copy-on-select = false
clipboard-paste-bracketed-safe = false
window-vsync = false
background-opacity = 0.9
unfocused-split-opacity = 0.75
window-height = 50
window-width = 120
@joewright
joewright / hidden-article.js
Created January 26, 2023 22:33
Preview hidden article
const https = require('https');
let urlvalue = new URL(process.argv[2]);
run(urlvalue).then(function () {
// console.log('done');
}, function (err) {
console.error(err);
});
@joewright
joewright / Setup.md
Last active April 18, 2025 23:36
JW quick mac setup

New Mac Initial setup

Do the mac machine setup stuff

  • fingerprint scan
  • no siri
  • turn on filevault
  • no tracking
  • no icloud acct
  • Remove everything from Dock
  • Pin Dock to the left
@joewright
joewright / delete-all-files.js
Last active December 7, 2020 22:02
Delete all files from a Slack workspace with a bot token and the Web API
const slack = require('@slack/web-api');
//@see https://api.slack.com/authentication/token-types#bot
const slackClient = new slack.WebClient('<your-bot-token>');
//start deletin'
deleteAllFiles().then(() => {
logg('All done');
}, err => {
console.error(err);
});
@joewright
joewright / blaseball-terminal-readme.md
Last active October 21, 2020 16:06
Blaseball terminal stream (NodeJS)

Prerequisites

  • NodeJS 12+
  • Chalk for nice terminal colors

Running it

node blaseball-terminal.js
# run and keep the feed alive indefinitely
node blaseball-termina.js --follow
# &gt;
@joewright
joewright / kaltura-media-flavor-asset-cleanup.js
Created May 7, 2020 00:38
Kaltura source file cleanup script
/**
* This script will take a list of Kaltura Media Entities,
* check to see if they have more than 1 flavor asset,
* and remove the Source flavor asset if it exists.
*
* Prerequisites:
* Install NodeJS v12+
* - Add this file to a folder
* - Add a file named "config.json" in the same folder, populate it with
* this: `{"session": "YOUR-VALID-KALTURA-SESSION-TOKEN"}`
@joewright
joewright / async-await.js
Created August 21, 2019 00:20
Async/await example
asyncAwaitTest();
async function asyncAwaitTest() {
let result1, result2, result3, results;
try {
result1 = promise1();
result2 = promise2();
result3 = promise3();
results = [await result1, await result2, await result3];
} catch(err) {
@joewright
joewright / repository.json
Last active August 27, 2019 19:47
jw-sublime-repository.json
{
"schema_version": "2.0",
"packages": [
{
"name": "Sublime-JSHint-05-2019",
"details": "https://github.com/joewright/Sublime-JSHint",
"releases": [
{
"sublime_text": "*",
"details": "https://github.com/joewright/Sublime-JSHint",