Skip to content

Instantly share code, notes, and snippets.

@robmiller
robmiller / gist:3153350
Created July 20, 2012 21:25
The Nexus 7

I've only spent half a day with it, but my first impressions are thus. It's partly about Android, since this is my first Android device, and partly about the Nexus itself.

The good

  • It's small! It's comfortable to hold in one hand, and the keyboard is a great size — where touchscreen phones are too small for proper two-thumbed typing, and where it can sometimes (with my tiny hands at least) be occasionally difficult to reach the middle of the keyboard on iPad, I've found the keyboard on the Nexus to be a great size. Swype adds some icing to the already-nice cake.

  • Build quality is excellent; it has a satisfying heft without being heavy, the leathery-plastic back is nice and grippy, and it just generally feels solid and well-constructed — in absolute terms, not just for its price point.

  • The screen is lovely; side-by-side with a retina iPad it's perhaps slightly inferior but as general usage goes it's an absolute pleasure. When you consider the cost, it's absolutely phenomenal.

@robmiller
robmiller / gist:4037534
Created November 8, 2012 08:22
Error when installing consular-iterm gem
This file has been truncated, but you can view the full file.
ERROR: Error installing consular-iterm:
ERROR: Failed to build gem native extension.
/Users/rob/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:44: Use RbConfig instead of obsolete and deprecated Config.
create /Users/rob/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/src/osx_ruby.h ...
create /Users/rob/.rvm/gems/ruby-1.9.3-p194/gems/rb-appscript-0.6.1/src/osx_intern.h ...
creating Makefile
make
@robmiller
robmiller / gist:4581651
Created January 20, 2013 20:51
How to gzip certain files in nginx
server {
listen 80;
root /var/www/vhosts/example.com/;
index index.html;
location ~ "\.(css|js|txt|html)$" {
gzip on;
}
}
@robmiller
robmiller / gist:4581672
Created January 20, 2013 20:55
Sample gzipping in Apache
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/x-javascript application/javascript text/javascript
</ifmodule>
@robmiller
robmiller / git-cleanup-repo
Last active February 27, 2024 10:09
A script for cleaning up Git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <rob@bigfish.co.uk>
# Adapted from the original by Yorick Sijsling
git checkout master &> /dev/null
# Make sure we're working with the most up-to-date version of master.
git fetch
@robmiller
robmiller / .vimrc
Last active February 18, 2022 11:53
Autoload sessions created by tpope's vim-obsession when starting Vim.
augroup sourcesession
autocmd!
autocmd VimEnter * nested
\ if !argc() && empty(v:this_session) && filereadable('Session.vim') |
\ source Session.vim |
\ endif
augroup END
@robmiller
robmiller / poll.sh
Last active December 15, 2015 06:28
ZSH one-liner to poll every five seconds to see whether a site is updated. Replace "example.com" with your domain, obviously. Relies on your site sending sensible "Age" headers.
while true; do [[ `curl -ILs http://example.com/ | grep 'Age:' | sed 's/Age: //'` < 10 ]] && say "It updated"; sleep 5; done
@robmiller
robmiller / plugin.php
Last active December 16, 2015 00:48 — forked from joncave/plugin.php
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE
@robmiller
robmiller / .gitconfig
Created April 9, 2013 22:38
A git alias to find out what changes were introduced by the last merge.
# usage, e.g.:
# git difftool `git last-merge`
# or:
# git log `git last-merge`
last-merge = "!echo $(git log -1 --merges --pretty=format:%P | cut -d' ' -f1)..$(git log -1 --merges --pretty=format:%P | cut -d' ' -f2)"
@robmiller
robmiller / .gitconfig
Last active May 20, 2020 13:45
Want to find out what changes were introduced by a particular merge commit? Hey, so do I! ALL THE TIME. These aliases will do that.
# `git merge-log` shows the commits that were introduced in a given merge
# `git merge-diff` shows the actual changes that were introduced by a given merge
# Both commands accept an optional commitish; if ommitted, the last merge commit is used
merge-span = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f"
merge-log = "!git log `git merge-span .. $1`"
merge-diff = "!git diff `git merge-span ... $1`"
merge-difftool = "!git difftool `git merge-span ... $1`"