Over time I’ve developed some particular processes that I find helpful when reviewing code. In particular, I often surprise people at how much review I do before I run the code. Sometimes I grab the branch so that I can use my local diff tools, but I don’t actually execute code until I’ve established some basic facts. This post is a little insight into what’s happening in this not-running-the-code-yet zone. Continue reading
Author Archives:
Recover Bitly Bundle Data
It turns out, it’s an undocumented feature on their API, so here is everything I know about recovering your bundle data, including the script I used to rescue my own data. Continue reading
PHP7: Easiest Upgrade Yet
Total lines of code change needed to make the @joindin API work on PHP7: zero
— Lorna Mitchell (@lornajane) May 14, 2015
Count Changed Lines in Git
git log --numstat
will show you how many lines were added (first column) and removed (next column) per file, kind of a more scientific version of the --stat
switch. And if you’re thinking of scripting this to gather stats, try it with --oneline
as well, it’s easier to parse.
Scaling and Sizing with PDFJam
pdfjam --suffix converted --papersize '{1920px,1080px}' --scale 0.4 --trim "-6cm -1cm 13cm 8cm" slides.pdf
The --suffix
is instead of giving an output filename, whatever you feed in ends up with the suffix in its filename. This is very handy because I use this command in a script and only need to pass in one variable. The --papersize
isn’t a switch I have used before either but you can set exact sizes for the final output which is nice. The --trim
switch can also be used to set --clip=true
to remove the trimmed space from the document if desired.
I find PDFJam a very handy tool but with not nearly enough blog posts and code snippets around, so I’m dropping my command for future reference (yours as well as mine!).
Vimdiff and Vim to Compare Files
Vivosmart Smart Watch
Continue reading