Skip to content

Instantly share code, notes, and snippets.

View jamesthomasonjr's full-sized avatar

JT jamesthomasonjr

View GitHub Profile
@jamesthomasonjr
jamesthomasonjr / keybase.md
Created January 25, 2019 20:35
keybase.md

Keybase proof

I hereby claim:

  • I am jamesthomasonjr on github.
  • I am jamesthomasonjr (https://keybase.io/jamesthomasonjr) on keybase.
  • I have a public key ASCHnn41VuiBPA5Coy9Ask3oz6SHtKvNhweAnL-7HPIeGwo

To claim this, I am signing this object:

@jamesthomasonjr
jamesthomasonjr / bytesToHuman.php
Last active March 27, 2019 18:34
A collection of unfinished code from rabbit holes I NEARLY went down but managed to save myself from... But maybe I'll finish them one day.
<?php
/**
* Converts a number of bytes to a human readable string
*
* Example:
* <code>
* $config->bytesToHuman(10); // 10 b
* $config->bytesToHuman(1000); // 1 kB
* $config->bytesToHuman(1024, 'iec'); // 1 KiB
@jamesthomasonjr
jamesthomasonjr / test-for-broken-links.ts
Last active April 5, 2019 14:49
Shoving broken-link-checker into mocha
@jamesthomasonjr
jamesthomasonjr / awsup.fish
Created April 10, 2019 14:54
SAML to AWS STS Keys helper function for Fish
#! /usr/bin/env fish
function _awsup_check_signin --argument-names 'credentials_file'
set --erase --universal AWS_ACCESS_KEY_ID
set --erase --universal AWS_SECRET_ACCESS_KEY
set --export --universal AWS_SHARED_CREDENTIALS_FILE "$credentials_file"
set --local account_name (aws iam list-account-aliases --output text --query 'AccountAliases[0]' 2>/dev/null)
if test -z "$account_name"
@jamesthomasonjr
jamesthomasonjr / spotify.py
Last active September 4, 2019 13:04
Add "Now Playing" information from Spotify to iTerm2 Status Bar
# ~/Library/Application Support/iTerm2/Scripts/AutoLaunch/spotify.py
#
# This script adds a new Status Bar component to iTerm2 that displays now playing information from Spotify
from subprocess import Popen, PIPE
import iterm2
PREFIX = 'PREFIX'
TEMPLATE = 'TEMPLATE'
@jamesthomasonjr
jamesthomasonjr / resume.json
Last active April 1, 2022 18:40
resume.json
{
"basics": {
"name": "James Thomason, Jr",
"label": "Full Stack Software Engineer",
"picture": "https://avatars.githubusercontent.com/u/691492?s=400&u=0552378d317cc1603b7c39f9e3c652bdcdc09659&v=4",
"email": "james@jamesthomasonjr.com",
"phone": "(810) 214 0123",
"website": "https://jamesthomasonjr.com",
"summary": "I am a Full-Stack Software Engineer who is passionate about engineering, architecture, and tooling. I am looking to fill a T-Shaped position in a team that solves interesting and challenging problems with innovative technology.",
"location": {
@jamesthomasonjr
jamesthomasonjr / jsxtovanilla.js
Last active December 11, 2019 16:30
Create vanilla DOM objects from JSX
function element(type, newProps, ...children) {
const element = document.createElement(type);
if (newProps) {
Object.entries(newProps).forEach(([key, value]) => {
if (typeof value == 'function') {
element[key] = value;
} else {
element.setAttribute(key, value);
}
@jamesthomasonjr
jamesthomasonjr / DoctrineObjectNormalizer.php
Created January 31, 2020 16:55
Incomplete Symfony Serializer Normalizer for Doctrine Objects
<?php
namespace Something\Somewhere;
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata as ODMClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadata as ORMClassMetadata;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
@jamesthomasonjr
jamesthomasonjr / generate-cert
Created February 21, 2020 16:27
Easily Generate & Trust a Self Signed Certificate on OS X
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# Configuration
# Certifiate TTL
DAYS=3650
# RSA Encryption Bits
BITS=2048
@jamesthomasonjr
jamesthomasonjr / environment
Created February 21, 2020 16:32
bash utilities
#!/usr/bin/env bash
# Utility functions for dealing with the environment
source "$(dirname ${BASH_SOURCE[0]})/sanity"
function environment::read {
# @TODO: Check for original allexport setting and return back instead of assuming it's off
set -o allexport