Skip to content

Instantly share code, notes, and snippets.

View W-A-James's full-sized avatar

Warren James W-A-James

  • MongoDB
  • Brooklyn, NY
View GitHub Profile
@W-A-James
W-A-James / find_todos.sh
Last active December 2, 2022 20:56
Checks for todos in the current repository
#!/usr/bin/env bash
set -e
todo_message=""
directory="."
has_ripgrep() {
which "rg" | grep "not found"
case $? in
0) # no ripgrep found
@W-A-James
W-A-James / get_workstation.sh
Created June 22, 2023 19:40
Get host name of named evergreen host
#!/bin/bash
# provide evergreen host name as only argument
# Returns <user>@<hostname> for the specified host and fails if no host is found
USAGE=$(cat << EOM
$0 <name>
EOM
)
NAME=$1
if [ -z $NAME ]; then
@W-A-James
W-A-James / mergeCSVs.ts
Last active February 9, 2024 18:28
mergeCSVs.ts
import * as fs from 'fs/promises';
class CSV {
filePath?: string;
headings?: string[];
data?: Record<string, any>[];
private constructor(path?: string, headings?: string[], data?: Record<string, any>[]) {
this.filePath = path;
this.headings = headings;