Skip to content

Instantly share code, notes, and snippets.

@andrewmcdonough
andrewmcdonough / rubocoper
Created November 17, 2021 13:19 — forked from deivid-rodriguez/rubocoper
Adds RuboCop to a project, one commit per cop
#!/usr/bin/env ruby
require 'open3'
#
# Adds RuboCop to a project, one cop per commit
#
class RuboCoper
def run
autocorrect_all
@andrewmcdonough
andrewmcdonough / swind
Created March 31, 2009 16:02
A bash script to move the focused window in X to different parts of the screen. Most useful when you assign shortcut keys to the various options, e.g. assign '<Super>Up' to run 'swind up'
#!/bin/bash
# Written by Andrew McDonough
# Prerequisites: xdotool must be installed and in your path (http://tinyurl.com/xdotool)
# A simple bash script that uses xdotool to move the window that is currently in focus to different parts of the screen.
# Particularly useful for reading web pages with flexible layouts on wide monitors.
# Assign the various options to keyboard shortcuts e.g. '<Super>Left' assigned to 'swind left'
# See http://tinyurl.com/ubuntukeys for help with assigning keyboard shortcuts.

Keybase proof

I hereby claim:

  • I am andrewmcdonough on github.
  • I am andrewmcdonough (https://keybase.io/andrewmcdonough) on keybase.
  • I have a public key whose fingerprint is 31E7 E554 B2BE EE38 8DA2 3D68 7BDD 9CCB 6BC2 5CBE

To claim this, I am signing this object:

Bánh mì in Shoreditch

  1. Keu!
  2. Banhmi11
  3. Nam Caphe
  4. Banh mi cart on Hoxton Street
  5. Aobaba
@andrewmcdonough
andrewmcdonough / gist:6763580
Created September 30, 2013 13:10
Rotating photos using imagemagick
Without cropping
mkdir converted
for file in *.JPG; do convert "$file" -rotate 180 "converted/$file" ; done
With a little cropping to clip the bike's seat from the photos:
for file in *.JPG; do convert "$file" -crop 4000x2600 -rotate 180 -gravity center "converted/$file" ; done
DisplayFormat = "<span>%%D%%</span> Days, <span>%%H%%</span> Hours and <span>%%S%%</span> Seconds!";
@andrewmcdonough
andrewmcdonough / gist:3793245
Created September 27, 2012 10:02
Squash or Badminton at the Britannia Leisure Centre
Squash or Badminton at the Britannia Leisure Centre
===================================================
I recently took out a racquets membership at the Britannia Leisure Centre in Hoxton,
and as part of my package, I get one free racquet sports booking per day. I'm keen
to use this as much as possible, and am often free to play before work (0815),
lunchtimes (1245 or 1300) or after work (preferably 1800, 1845 or 1930). The evening slots
quite usually get booked up a week in advance, but morning and lunch ones are
frequently available with only a day's notice.
@andrewmcdonough
andrewmcdonough / kebabfriday
Created July 13, 2012 13:57
kebabs to try
=====
Patogh - Iranian, Edgware road
Anatolia Ocakbasi - mare st
gokyuzu - gree lanes
kebab kid - new kings road
Marathon Kebab House - chalk farm
petra caledonian road
Maedah Grill
Bosphorus Kebabs - old brompton road
Beyti - green lanes
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd">
<Activities>
<Activity Sport="Running">
<Id>2012-03-18T12:41:04Z</Id>
<Lap StartTime="2012-03-18T12:41:04Z">
<TotalTimeSeconds>313.8300000</TotalTimeSeconds>
<DistanceMeters>1000.0000000</DistanceMeters>
<MaximumSpeed>4.0276432</MaximumSpeed>
@andrewmcdonough
andrewmcdonough / gist:1892666
Created February 23, 2012 12:43
Nifty trick with bundler and rvm. In your app directory:
$ echo "export PATH=.bundle/bin:$PATH" >> .rvmrc
$ bundle install --binstubs=.bundle/bin
$ cd ..
$ cd <app-dir>
installs binstubs into app_dir/bin, and rvm adds ./bin to your path automatically (and takes it away again when you cd out of the app dir)
no more bundle exec