View README.md

Given two directories, one a Git repository and the other not, how do you apply the recursive diff between those two directories as a patch to the Git repository?

This might happen if you download source code without its history and make changes to it, then later acquire the history and wanting to secure your changes.

The easy way ...

View Makefile
src=foo.lisp
obj=$(src:.lisp=.fasl)
bin=foo
.SUFFIXES:
.PHONY: eval
eval:
sbcl --noinform --load $(basename $(src)) --eval '(main)' --eval '(exit)' \
2>/dev/null
View bank-to-ynab.js
var save = function(transactions) {
const filename = "ynab.csv";
const blob = new Blob([transactions], {type: 'text/csv'});
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, filename);
} else {
const elem = document.createElement('a');
elem.href = window.URL.createObjectURL(blob);
elem.download = filename;
document.body.appendChild(elem);
View convert-doc-to-docx.md

Microsoft Office 2007 and 2010 include a tool that can convert .doc-files to .docx-files from the command line.

This will not get rid of the compatibility-mode message -- that requires opening the file and saving it as a new format -- but it does help with reducing file sizes and cross-platform compatibilities.

The tool is called Wordconv.exe and is located in the root Office folder, e.g. Office14.

View ubuntu-with-cinnamon.md

Installation

Disable the Unity overlay scrollbar, which causes rendering issues in Cinnamon:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

Install Cinnamon from moorkaï's PPA:

View open-msys2-shell-extension.md

You can add Windows shell extensions for launching MSYS2 Bash sessions in a target directory.

For right-clicking the background of an open folder, use the command

C:\msys64\usr\bin\mintty --icon /msys2.ico /usr/bin/env CHERE_INVOKING=1 /usr/bin/bash --login

For right-clicking a folder, use the command

View tmux-24bit-ncursesw.sh
#!/bin/bash
set -o errexit
ncursesw_dir=/usr/include/ncursesw
[[ -d "$ncursesw_dir" ]] ||
{
echo "fatal: ncursesw not found at ${ncursesw_dir}" >&2
exit 1
}
View ubuntu-setup.sh
#!/bin/bash
set -o errexit
# Neovim
sudo add-apt-repository --yes ppa:neovim-ppa/unstable
# Git
sudo add-apt-repository --yes ppa:pdoes/ppa
sudo apt-get update
View find-skip-vcs-directories.md

This command recursively finds every file matching the glob pattern *.* (name.extension) in the working directory, excluding child directories whose names start with ..

This is useful for skipping various VCS directories, for instance.

find . -type d -path './.*' -prune -o -type f -name '*.*' -print
View mdpp.md

Idea for a Markdown preprocessor

Feature master list:

  • Table of contents
    • {{toc}}?
    • ATX headers
    • two-pass processing for consistent stream
    • Ignore # in code blocks, quotes
  • File transclusion