git diff -U1 |
perl -ne '
if (m|^\+\+\+ b/(.*)|) { $name = $1 }
if (m|^@@.*\+(\d+),(\d+)|) { $from = $1; $to = $from + $2; print "clang-format -lines=$from:$to -style=file -i $name\n" }
' |
sh
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
PLANTUML_JAR_URL = https://sourceforge.net/projects/plantuml/files/plantuml.jar/download | |
DIAGRAMS_SRC := $(wildcard diagrams/*.plantuml) | |
DIAGRAMS_PNG := $(addsuffix .png, $(basename $(DIAGRAMS_SRC))) | |
DIAGRAMS_SVG := $(addsuffix .svg, $(basename $(DIAGRAMS_SRC))) | |
# Default target first; build PNGs, probably what we want most of the time | |
png: plantuml.jar $(DIAGRAMS_PNG) | |
# SVG are nice-to-have but don't need to build by default | |
svg: plantuml.jar $(DIAGRAMS_SVG) |
Suppose you have weird taste and you absolutely want:
- your visual selection to always have a green background and black foreground,
- your active statusline to always have a white background and red foreground,
- your very own deep blue background.
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
Gist title: "BASH: ISO 8601 Timestamp with Milliseconds" | |
Summary: How to get an ISO 8601 timestamp with milliseconds in BASH |
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
Quick git tip: Most of you know (and love) git's "bisect" command, but how many have used "git bisect run"? Specify a shell script/command, and git will automatically run it on each bisect step. If it exits with a 0, the commit is marked "good". Anything else, and the commit is marked "bad". | |
For example, want to find the cause of a failing test? | |
git bisect start <failing commit> <passing commit> | |
git bisect run sh -c '(cd app && grunt test)' | |
Voila! Git will automatically find the first commit in the given range that fails the tests. | |
http://git-scm.com/docs/git-bisect#_bisect_run |
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
# Sample latexmk configuration to use xelatex and Preview on OS X. | |
# Should help if you want to use latexmk with MacTeX. | |
# | |
# 1. Install MacTeX | |
# 2. Put this file in ~/.latexmkrc | |
# 3. Continuously recompile and preview your document with the command: | |
# latexmk -pvc myfile.tex | |
$pdflatex = 'xelatex -interaction=nonstopmode %O %S'; | |
$pdf_previewer = 'open -a Preview "%S"'; |