Skip to content

Instantly share code, notes, and snippets.

@ericbiewener
ericbiewener / misc-notes.md
Last active February 16, 2024 18:56
Misc Notes

git

  • git blame -w -C -C -C: Quickly get to the bottom of who truly wrote the lines in question, skipping over whitespace, line movements, etc.
  • git log -S: Filter log on commits that have changes with code that match a given regex.
  • git --word-diff: Show diffs on a per-word basis.
  • git maintenance start: run maintenance tasks in the background. Turn on for any repos where you routinely see costly maintenance tasks tacked on to other commands you issue.
  • git config core.fsmonitor true: turns on a file system monitor that computes git status results in the background after every file change, so that the git status command itself is very fast because it doesn't need to compute anything. Very useful for large repos.
@ericbiewener
ericbiewener / .p10k.zsh
Created July 7, 2022 19:17
Powerlevel 10k Config
# Generated by Powerlevel10k configuration wizard on 2022-07-07 at 10:06 PDT.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 62739.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, light,
# angled separators, sharp heads, flat tails, 1 line, sparse, few icons, concise,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@ericbiewener
ericbiewener / refHeap.js
Created June 12, 2020 23:32
Allocate a bunch of nulled React Refs
const BATCH_SIZE = 10000
const TOTAL_SIZE = 1000000
const totalBatches = TOTAL_SIZE/BATCH_SIZE
const o = {};
let i = 0;
let batchCounter = 0
const allocateNullishProps = () => {
console.log(`Allocating batch ${++batchCounter} of ${totalBatches}`)
@ericbiewener
ericbiewener / readDirTest.js
Created July 27, 2019 19:17
Synchrnous vs Async `fs.readdir` performance test
const path = require('path')
const fs = require('fs-extra')
function isFile(file) {
try {
return fs.statSync(file).isFile()
} catch (e) {
if (e.code !== 'ENOENT') throw e // File might exist, but something else went wrong (e.g. permissions error)
return false
}
set smoothscroll
let scrollduration = 250
let typelinkhintsdelay = 0
let blacklists = ["https://mail.google.com/*","https://github.com/* t"]
@ericbiewener
ericbiewener / prepush.py
Created April 19, 2018 19:31
Lint fix git prepush
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import subprocess
import os
# sys.exit(1)
class style: