Skip to content

Instantly share code, notes, and snippets.

@borekb
borekb / clink.lua
Last active April 26, 2020 20:07
cmder `clink.lua` to show number of commits to push. See comment below for description.
@borekb
borekb / install.sh
Created April 9, 2019 16:55
Install dotfiles
#!/usr/bin/env bash
# Installs symlinks to dotfiles into the $HOME directory.
#
# Flags:
#
# -n Dry run
# -f Force – overwrite files in $HOME if they exist
#
# Inspired by https://github.com/mplacona/dotfiles/blob/65329dc/bootstrap.sh but quite different in the end.
@borekb
borekb / finder-customizations.sh
Created November 18, 2018 10:40
macOS finder customizations
# Finder: show full path in title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Finder: allow text selection in Quick Look
@borekb
borekb / msys2-pty.md
Created July 29, 2018 14:26
Dealing with tty / pty in MSYS2 shells

Dealing with tty / pty in MSYS2 shells

In my experience, the biggest practical hurdle when running a mix of native and MSYS2 programs is related to tty / pty. I wish I understood perfectly what is going on but at least I think I can explain the problem and what are the options. When I learn more, I'll be happy to update this post.

The problem

When you run a shell of your choice like bash.exe or zsh.exe, you have three main options:

  1. Run it in the mintty terminal.
  2. Run it in Windows console ("cmd.exe").
@borekb
borekb / 7-zip-cheat-sheet.md
Last active May 23, 2018 08:40
7-Zip CLI cheat sheet

7-Zip Cheat Sheet

Extract to directory

7z x archive.zip -oSomeDirectory
@borekb
borekb / merge-repos.sh
Last active February 12, 2018 09:14
A script to merge repositories. Used in blog post (CZ) https://borekb.cz/2017/01/monorepo/. Updated version: https://gist.github.com/borekb/b4aa4f97ccd826dce1d4793a0d54fd26
#!/bin/bash
# Merges child repo into target repo. Maintains branches and tags, filters history.
#
# Based on this amazing article: https://gofore.com/merge-multiple-git-repositories-one-retaining-history/
#---------------------------------
# Variables
#---------------------------------
@borekb
borekb / merge-repos.sh
Created February 12, 2018 09:13
Script to merge repositories. Updated version of the original Gist https://gist.github.com/borekb/eccc0af01f3b2c1d47bb7955a08bc214
#!/bin/bash
# Repo merge script used to merge OLD_REPO into TARGET_REPO.
# Based on https://gofore.com/merge-multiple-git-repositories-one-retaining-history/
# How to use:
#
# 1. Create a temp directory
# 2. Checkout TARGET_REPO and OLD_REPO there
# 3. Put this script into the temp directory, side by side with the repos.
@borekb
borekb / backticks-in-headings.md
Last active August 20, 2017 09:31
Markdown backticks in headings example
ToC:

- [Hello `make`](#hello-make)

## Hello `make`

@borekb
borekb / README.md
Last active November 28, 2016 22:44
Chrome MRU tabs extension

This has been sent to several freelancers on Fiverr.

I'm looking for an extension that provides MRU (most-recently-used) tab behavior in Chrome on Windows. This is generally hard to achieve as it's not supported natively but I think there's a trick: there's a CLUT extension that implements the MRU behavior (https://chrome.google.com/webstore/detail/clut-cycle-last-used-tabs/cobieddmkhhnbeldhncnfcgcaccmehgn) and I can manually update the Preferences file to change the CLUT's default Alt+S shortcut to Ctrl+Tab. Then it works for a single session. The problem is that after I restart Chrome, the shortcut is back to Alt+S.

So the gig would be about creating an extension (or an extension plus a small Chrome app) that:

  • Expects CLUT to be installed
  • On every Chrome start, or shortly after that, searches the Preferences file for Alt+S and replaces it with Ctrl+Tab.

That's it. If I understand the security constraints correctly, this would need to be a pair of Chrome app that has the filesystem

@borekb
borekb / README.md
Last active August 29, 2016 13:09
GitHub-style preview for Markdown Edit