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

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:

@andrewmcdonough
andrewmcdonough / gist:c8f18fa63b767a4cd60b
Created May 14, 2014 04:32
Competition: Win a ticket to Digital Sizzle, Beards in Wonderland
In three days time, on Saturday 17th of May, the best tech party of the year will be taking place in London. It's called Digital Sizzle, Beards in Wonderland, and it's going to be amazing.
http://thedigitalsizzle.com
When I heard about it, I bought two tickets stright away.
Unfortunately however, I'll be out of the country. Instead of selling the tickets, I'd like to give them away to one of the lovely people in London's tech scene. For a chance to win one of these tickets, all you need to do is share the following Facebook post, or retweet the following tweet.
Share this:
https://www.facebook.com/andrewcmcdonough/posts/10152071602295079
@andrewmcdonough
andrewmcdonough / gist:9783502
Created March 26, 2014 13:47
Naive solution to codebar lesson 3, deliberately not using classes
#!/usr/bin/env ruby
require 'pstore'
@data = PStore.new("contacts.pstore")
@data.transaction do
@data["contacts"] ||= []
@data.commit
end

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>