Skip to content

Instantly share code, notes, and snippets.

@pqt
pqt / reset_git_history.sh
Created March 26, 2020 03:30
Are you about to open-source a private repository? Do you want to squash all history into a single commit before making the code public? This one-liner takes care of it
# Modified slightly from https://twitter.com/mathias/status/1045312837671882752
git reset $(git commit-tree HEAD^{tree} -m 'first commit')
<link rel="shortcut icon" width=32px>
<canvas style="display: none" id="loader" width="16" height="16"></canvas>
<script>
class Loader {
constructor(link, canvas) {
this.link = link;
this.canvas = canvas;
this.context = canvas.getContext('2d');
this.context.lineWidth = 2;
git rm -r --cached .
git add .
git commit -m ".gitignore fix"
@pqt
pqt / spacer.sh
Last active November 15, 2020 05:37
Add a spacer to your dock in MacOS Big Sur (and others, though untested)
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
// https://i.imgur.com/V0PNlIZ.png
(async () => {
const a = await getData();
const b = await getMoreData(a);
const c = await getMoreData(b);
const d = await getMoreData(c);
const e = await getMoreData(d);
console.log(e)
})();