- Clone the repo.
- Use
git rebase -i --root
- vim will open. Select the commits you want to modify by changing
pick
toedit
. If you would like to change all the commits, perform the following replace::%s/^pick/edit/g
. This command changes all instances of "pick" at the start of lines to "edit". - You will now be shown all the selected commits one by one. Each commit message will be displayed. You have two options:
- If you would like to keep the commit author details the same, do a
git rebase --continue
. - If you would like to change it to a different name/email, do
git commit --amend --reset-author
. If--reset-author
is specified, it will use the details from your git config. (If you need to specify an alternate name/email, you can do so with--author="John Doe <[email protected]>"
. If you would like to change the time to a previous date, you can do so with--date "2 days ago"
.)
- If you would like to keep the commit author details the same, do a
- Do the same for all the commits and finish the rebase.
- Perform
git push -f origin master
to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with node --expose-gc bench.js ../automerge-paper.json.gz | |
// automerge-paper.json.gz from https://github.com/josephg/crdt-benchmarks | |
// Read in a patch file and check that the patches all apply correctly. | |
const fs = require('fs') | |
const assert = require('assert') | |
const zlib = require('zlib') | |
const automerge = require('automerge') | |
const v8 = require('v8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Generate a dbdiagram for dbdiagram.io from a dbt project. | |
# | |
# Usage: | |
# 1. Run `dbt docs generate` first. | |
# 2. Run `dbt_to_dbdiagram.rb` | |
# 3. Paste the output in https://dbdiagram.io/ | |
require 'yaml' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Change following to '0' for output to be like ls and '1' for eza features | |
# Don't list implied . and .. by default with -a | |
dot=0 | |
# Show human readable file sizes by default | |
hru=1 | |
# Show file sizes in decimal (1KB=1000 bytes) as opposed to binary units (1KiB=1024 bytes) | |
meb=0 | |
# Don't show group column |
Nix is a purely functional package manager
/nix
folder in my dotfiles repo
this is how I utilize nix to have better management of initial setup in terms of both logically and performantely better
How I package Docker image using Nix
My first attempt to package with Nix for a Docker image with Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# fetch server hostnames from `sdm status` to use as completions for `sdm ssh [hostname]` | |
# save the sdm status to a local file from a cron job to speed this up a lot: | |
# sdm status --filter 'TYPE:ssh*' | tail -n +2 | awk '{print $1}' | sort -u > /var/tmp/sdm-status | |
# h/t https://iridakos.com/programming/2018/03/01/bash-programmable-completion-tutorial | |
update_frequency=4h | |
compwords_file=/var/tmp/sdm-status |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
set -u | |
emulate -R ksh | |
sudo renice -10 $$ >/dev/null | |
time2sec() { | |
local time="$1" | |
shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set the system time for our tests. | |
* This ensures that our tests can't fail based on the local time of the CI machine. | |
* This guards against app code where the behavior changes based on the device time. | |
* For example, a test might fail if we attempt to set the search time "before now". | |
*/ | |
beforeAll(() => { | |
// @TODO: 'modern' is default once we upgrade to Jest 27 https://jestjs.io/blog/2020/05/05/jest-26#new-fake-timers | |
jest.useFakeTimers("modern"); | |
const JS_DATE_11_AM = new Date(new Date().setHours(11, 0, 0, 0)); |