Skip to content

Instantly share code, notes, and snippets.

View designfrontier's full-sized avatar

Daniel Sellers designfrontier

View GitHub Profile
@designfrontier
designfrontier / archive-project.sh
Last active November 8, 2024 16:23
archive and clean
#! /bin/bash
mv $1 ~/projects/Archive
# Loop over each first-level subdirectory
for dir in ~/projects/Archive/*/; do
# Check if 'node_modules' exists within the subdirectory
if [ -d "${dir}node_modules" ]; then
echo "Deleting ${dir}node_modules"
rm -rf "${dir}node_modules"
fi

Keybase proof

I hereby claim:

  • I am designfrontier on github.
  • I am designfrontier (https://keybase.io/designfrontier) on keybase.
  • I have a public key ASC9jH4-tHGo5bMNnni-UmID4THIF6EXDAubl9ueBxJ2ZQo

To claim this, I am signing this object:

#!/usr/bin/env bash
# https://id.atlassian.com/manage-profile/security/api-tokens
# for getting your tokens :pointup:
GIT_MESSAGE=$(git log -n 1)
read -p "Brief Summary:" SUMMARY
read -p "Description:" DESCRIPTION
echo ""
echo 'Please enter ticket type: '
select T in "${JIRA_TICKET_TYPES[@]}"
do
@designfrontier
designfrontier / enforce-test-file-changes
Created October 22, 2021 22:25
A simple way to enforce that changes to js/ts files require changes to their corresponding test files in legacy code bases where you are trying to expand code coverage over time.
#!/usr/bin/env node
const IGNORE_FILES = [];
const filesToParse = JSON.parse(process.env.files);
const filesThatNeedTests = filesToParse.filter((f) => {
const fileNameArray = f.split('.');
if (IGNORE_FILES.includes(f)) {
return false;
}
[user]
name = Daniel Sellers
[color]
ui = true
[alias]
co = checkout
cob = checkout -b
st = status
ci = commit
br = branch
@designfrontier
designfrontier / enforce-package-lock
Created May 12, 2021 21:09
node script that returns non-zero exit code if dependencies are updated but not the lock file
#!/usr/bin/env node
const cp = require('child_process');
const pkg = require('../package.json');
const filesToParse = JSON.parse(process.env.files);
const checkPackageJSON = () => {
const s = cp.execSync('git diff HEAD~1 HEAD package.json').toString();
const changedLines = s
.match(/[+]( ){2,4}.*/g)
@designfrontier
designfrontier / aws-auth-error-decode
Created March 17, 2021 20:51
aws-auth-error-decode
#!/usr/bin/env bash
aws sts decode-authorization-message --encoded-message "$1" --query DecodedMessage --output text | jq '.'
#!/usr/bin/env bash
string="{\"$2\": \"$3\"}"
mount=$1
vault write $mount @<(vault read -format json $mount | jq ".data + $string")
@designfrontier
designfrontier / slackme
Last active December 3, 2018 16:20
Pipe to Slack
#!/usr/bin/env node
const http = require('https');
const url = process.env.SLACK_URL;
let data;
process.stdin.resume();
process.stdin.setEncoding('utf8');
@designfrontier
designfrontier / subl-patch
Created March 14, 2018 02:14
opens all of the files that have changed between where you are in git and HEAD on master in sublime. Handy
#!/usr/bin/env node
const cp = require('child_process');
cp.exec('git diff --name-only master HEAD', (err, out) => {
const files = [].concat('subl', '.', out.split('\n')).join(' ');
cp.exec(files, (e, o) => {
if (e) {
console.log(e, 0);
process.exit(1);