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.
Tag Archives: tips
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
Todotxt on Android and Ubuntu
- I use Linux (specifically Ubuntu 14.10)
- I don’t use a pointing device. At all. If I can’t use a tool from the keyboard, I can’t use it at all (as a side effect, I use keyboard enablers in my browser so if your website has “helper” keyboard shortcuts, I probably can’t use that either)
- My other devices (phone, tablet, work phone) are all android
Taken together, this makes finding tools a challenge – but I’ve had good experiences with todotxt and the ecosystem around it. Continue reading
Status Check on All Vagrant Machines
It turns out that (since vagrant 1.6) you can ask vagrant to tell you which of its machines are running, using the command:
vagrant global-status
Where did all my system resources go? Now I know!
Vim and HTML Tags with the Surround Plugin
Continue reading
Git Submodules for Dependent or Common Code
View Only Headers with Curl
HEAD
request changes the output I get, so I really do want to GET
and then only see the headers.
Handily, when you use the -v
verbose flag with curl, it sends the output to stdout as usual, but the extra information including the headers goes to stderr. This means that I can therefore view the headers only throwing away stdout completely:
curl -v -s http://awesome-site.com 1> /dev/null
(you need the -s
to stop curl from “helpfully” printing progress bars as well)
Colourless Git Output
Try putting the following into .git/config
:
[color] branch = false diff = false interactive = false status = false
I had expected to be able to set color.ui
to false but that didn’t seem to make much difference, so I now use the settings above. I thought I’d drop it here in case anyone else is looking for the same thing.
Copy/Pasting and Vim
To paste between vim and something else, use the + (plus) buffer in vim. It contains the contents of your system clipboard, and you can also write to it. If you’re not already using buffers in vim, then you should probably read the excellent documentation but for a very quick start:
- To copy something into the buffer, select it in visual mode and type
"+y
- To paste from the buffer, type
"+P
I had no idea how I’d missed this really fundamental trick, so I thought I’d share!