Mike Rogers on a Snowmobile

This is the archive of all the blog posts I've written over the past few years.

2018

Combining timecop and VCR during testing

Speed up your tests and make them more replayable.

Posted on

Building internet safe addresses for ActionMailer using Mail::Address

Sometimes you need to pass in some funky characters to your mail parameters, use Mail::Address to do it safely.

Posted on

Don't just [FILTER] passwords by default, filter tokens and keys!

Update your config.filter_parameters to have sensible defaults, so logs don't have sensitive information in them.

Posted on

Where to buy your domains

Domain registrars is hard get right, here are the ones I like.

Posted on

Removing Active Storage Routes from Rails 5.2

Active Storage is pretty cool, but it added new routes to my old rails apps.

Posted on

Setting up Heroku release tasks for Ruby on Rails

Run migrations, clear caches and other things without downtime when deploying.

Posted on

Using Decorators in Rails

Avoid adding if/else logic inside view, instead use Decorators.

Posted on

Using I18n in Rails Validations

Don't hard code strings into your models, put them in your locales!

Posted on

Stop resizing images with Ruby

Ruby shouldn't be used to resize images, instead do it in the cloud.

Posted on

2017

Waiting for Cloudinary uploads to finish with Rails UJS

How to nicely disable a form to let uploads finish before submitting to the server.

Posted on

Building and shipping TrackChanges

I shipped a Chrome extension, it was an adventure.

Posted on

A year after monetising my Chrome Extension

I learnt a lot in the last year, I had to share what I learnt!

Posted on

Elegant Rails 5 Scopes

Stop writing raw SQL, instead let Active Record handle that for you.

Posted on

Mailer Previews in Rails 5

How to share Rails 5 mailer previews in a staging environment

Posted on

2016

Lessons learnt from monetising my Chrome Extension

I made £170.35 over 3 months, and I made a bunch of mistakes along the way!

Posted on

Making Remote Working Actually Work

The video of the talk I done at PHPHants on Making Remote Working Actually Work

Posted on

Flattening an array with Regex in Ruby (Interview Question)

I was asked to flatten an array in Ruby, without using the flatten method. Here is the terrible answer I came up with.

Posted on

Why I'm charging for LivePage

I made LivePage (my Chrome Extension) £2.99 a year, here is the explanation of why, and my future plans.

Posted on

Improving Rails Enums using i18n

A helper method I wrote to make Enum in Rails more user presentable using i18n.

Posted on

My first year as a Digital Nomad

A handful of pictures showing my first year of being a Digital Nomad.

Posted on

Rails internationalisation (i18n) cheatsheet

A collection of examples of how to use the rails internationalisation (i18n) and a few quick start tools.

Posted on

2015

Additional Ruby Solr Sunspot setup tweaks

A few tweaks I made to my searchable blocks to make Solr Sunspot better.

Posted on

6 Nifty Rails hacks you should be using

Six fairly generic Rails tips that are pretty obvious, but will improve performance and help keep your codebase tidier. Number 3 won't shock you.

Posted on

Monitor Rails memory usage during acceptance tests

I had a memory leak in my Rails app and tracked it down using Oink.

Posted on

Seeding with Seedbank

A video explaining how to use Seedbank in a rails project.

Posted on

Some thoughts on making a jQuery plugin

I wrote a jQuery Plugin. Here are notes on the parts of used.

Posted on

Displaying a Twitter feed

How to use the twitter gem to display tweets then fragment caching to keep things quick.

Posted on

How to make a contact form

How to make a contact form in Rails with a BDD approach

Posted on

I finally rebuilt my site :D

A overview of some of the techniques I used to quickly rebuild my site

Posted on

2014

My OSX setup

The brews I normally have to run to get setup

Posted on

Geeklet for monitoring server ping

A geektool geeklet code sample that shows server status and ping.

Posted on

2013

How to setup a global .gitignore

How to setup a global gitignore which will help ignore annoying system files accorss all your git projects.

Posted on

JustDelete.Me Chrome Extension

JustDelete.me chrome extension blog post giving a elevator pitch on its functionality with a screenshot.

Posted on

Preparing your blog for traffic spikes

A collection of benchmarking tools and caching solutions which should help keep a small site online during traffic spikes.

Posted on

Reducing position:fixed; rendering lag due to scaled images

Using position:fixed; causes the page to lag when your scrolling, scaled images make this issues worse. Here is a fix to make it less noticeable.

Posted on

My Web Development Stack

A few details about my local development environment and software I use.

Posted on

How to backup a website to S3 on Ubuntu Server

A script breakdown of how to move backup your website (files and database) to Amazon S3 on Ubuntu Server

Posted on

How to use Twitter OAuth v1.1 with JavaScript/jQuery

A simple JavaScript patch for twitter API V1 retirement issue.

Posted on

Update all the things!

I updated a few of my Wordpress plugins, this is the summary.

Posted on

2012

Stuff I'm going to use more in 2013

6 new year resolutions for 2013.

Posted on

List current active connections on Mac OSX

A shell script that shows active connections on Mac OSX

Posted on

How to get better signal from the Virgin Media Super Hub

A method to improve the signal of the Virgin Media SuperHub

Posted on

5 tips for traveling with Android smartphones

A few tips for traveling with an Android phone

Posted on

Getting started with Git

A video of the talk I gave in April on getting started with Git

Posted on

Speed up bluetooth devices connecting to OSX

An OSX trick to make bluetooth devices connect faster.

Posted on

How to use Google Web Fonts on Wufoo forms

How to embed custom fonts from google web fonts into Wufoo forms.

Posted on

2011

MySQL REPLACE function

An example of how to use the MySQL REPLACE function.

Posted on

PDO (PHP Data Objects) - Starter Guide

How to move off the deprecated mysql_* and start using PDO in PHP

Posted on

Using cookieless domains to improve a website performance

A demo of how to set up a cookieless domain

Posted on

JavaScript Selector Methods (Use CSS selectors in JS)

How to use querySelector in JS to make CSS style selections in JS

Posted on

How to do a timed shutdown on your PC

How to do a timed shutdown on Windows 7 and 8

Posted on

PHP's Ctype Functions

PHPs Ctype functions which validate strings quickly without regex.

Posted on

How to validate an email address with PHP

A method of validating emails in PHP without regex.

Posted on

Getting the Weather in PHP

How to use a secret google API to get the weather.

Posted on

My Resolutions for 2011

New years resolutions ofr 2011

Posted on

2010

How To: Hello World in Java (Video)

How to do hello world in Java via netbeans

Posted on

How to use the Filter Functions in PHP

An example of how to use PHP filter functions to validate and sanitise strings.

Posted on

2009

Apple Can't Do Math

A mistake in a mailer from Apple.

Posted on

Decrease loading times via .htaccess

A trick to reduce load times with .htaccess (gzipping)

Posted on

Securing Links

A simple link cloaker example with PHP

Posted on

Cron Jobs and cPanel

How to set up and cron job in cPanel

Posted on