Skip to content

Instantly share code, notes, and snippets.

View kreig303's full-sized avatar
๐Ÿ˜‡

Kreig Zimmerman kreig303

๐Ÿ˜‡
View GitHub Profile
@maxkorp
maxkorp / new-install.sh
Last active September 25, 2018 18:56
New mac install shell script
#!/bin/bash
# Ensure not root
{
if [ "$EUID" -e 0 ]
then echo "Please do not run this script as root"
exit
fi
}
@Kovrinic
Kovrinic / .gitconfig
Last active May 13, 2025 07:15
git global url insteadOf setup
# one or the other, NOT both
[url "https://github"]
insteadOf = git://github
# or
[url "[email protected]:"]
insteadOf = git://github
@varjmes
varjmes / git-object-filenames.js
Created March 30, 2019 09:13
Calculating SHA-1's of various strings to replicate how git calculates object filenames
// Calculating and printing the SHA-1 hash of strings
const crypto = require('crypto')
const zlib = require('zlib')
function hashIt(string) {
return crypto
.createHash('sha1')
.update(string, 'utf-8')
.digest('hex')
@varjmes
varjmes / vrs.js
Created March 30, 2019 11:04
initialising a vrs (git) repository with ref and object directories
const fs = require('fs')
const path = require('path')
const directories = ['objects', 'refs']
const command = process.argv[2]
switch (command) {
case 'init':
const repoPath = process.argv[3] || ''
const gitPath = path.resolve(repoPath, '.git')
@Jaid
Jaid / migratingRules.md
Last active May 10, 2025 11:01
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{