Skip to content

Instantly share code, notes, and snippets.

View jeremyfiel's full-sized avatar
🏒

Jeremy Fiel jeremyfiel

🏒
View GitHub Profile
@april
april / git-log-json.sh
Last active December 20, 2023 13:11
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
\a an ASCII bell character (07)
\d the date in "Weekday Month Date" format (e.g., "Tue May 26")
\e an ASCII escape character (033)
\h the hostname up to the first '.'
\H the hostname
\j the number of jobs currently managed by the shell
\l the basename of the shell's terminal device name
\n newline
\r carriage return
\s the name of the shell, the basename of $0 (the portion following the final slash)
@sawyerh
sawyerh / Validator.js
Created April 2, 2020 13:47
Ajv wrapper for validating JSON Schemas
const Ajv = require("ajv");
const ajvKeywords = require("ajv-keywords");
// This is an export of all of your JSON Schema files
const schemas = require("../schemas");
// EXAMPLE:
// This could live in a ApplicationError.js file and be shared with other files
const ApplicationError = class ApplicationError {
/**
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active May 6, 2024 12:29
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@tylertadej
tylertadej / git-cheatsheet.md
Last active May 29, 2023 01:51
Pro Git commands for Git users

Git Your Act Together

Git Setup

Global settings stored in a system .gitconfig file; view file using $ cat ~/.gitconfig
Single repo settings stored in /.git/config in your project folder
View current configurations in the terminal window
$ git config --list
$ git config <level> --list