Skip to content

Instantly share code, notes, and snippets.

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

Warren James W-A-James

View GitHub Profile
@W-A-James
W-A-James / log_pager.sh
Created January 28, 2025 19:17
mongo log pager
#!/bin/env bash
logFile=$1
if [ -z "$logFile" ]; then
echo "Usage: ./log_pager.sh <log file>"
exit 1
fi
if [ ! -f "$logFile" ]; then
echo "File '$logFile' not found!"
@W-A-James
W-A-James / bson.code-workspace
Created August 30, 2024 14:25
js-bson workspace
{
"folders": [
{
"name": "bson",
"path": "../drivers/js/bson"
}
],
"settings": {
"window.title": "bson",
"editor.codeActionsOnSave": {
@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;
@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 / 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