This is new to me, but probably old hat to vim regulars. You can have conditional statements in your vimrc config depending on which machine you are working on. In this case I have disabled end of line white space cleaning on my ‘calcifer’ and ‘alderann’ machines.
" get hostname
let machine = substitute(system('hostname'), "\n", "", "")
" auto strip whitespace when saving
" don't auto strip on these machines
if machine !~ "[calcifer|alderann]"
autocmd BufWritePre * :%s/\s\+$//e
endif
I’ve taken to sharing my development workbench and vim configuration across multiple machines and this comes in really handy.
It’s a couple of months since our wedding on September 3rd and just last week over 3500(!) photos from our photographer arrived. I’ve shared a few of them on Flickr, along with some honeymoon snaps we took ourselves.
Huge thanks to Sara Mazzei at Infinity Weddings & Events for organising everything. From helping us find the venue to all the little details on the day, Sara and her team made everything work perfectly. I can’t recommend Infinity Weddings highly enough.
We had an amazing day and the ‘road trip’ holiday of a lifetime. Sitting here in cold, dark Dublin it all seems so long ago! I can’t believe its been over six months since my last post! I’m pretty sure that getting married, taking a holiday and planning a move are all good excuses. More soon…
An Eley's No. 2 is an excellent argument with gentlemen who can twist steel pokers into knots. That and a tooth-brush are, I think, all that we need.Sherlock Holmes, Sir. Arthur Conan Doyle
Oisin Hurley gave a great talk on ‘Constructing Web APIs with Rack, Sinatra and MongoDB’ at Ruby Ireland last Tuesday. I took the opportunity to try recording the video/audio of his presentation and map it together with his slides on slideshare. While quality isn’t anything near HD, using a combination of iMovie and Screenflow I got there in the end.
Thanks to everyone who showed up last night for the monthly Ruby Ireland user group meet-up at the Twisted Pepper. Unfortunately we completely forgot to try recording the presentation, but for those interested the slides are available here.
There did seem to be a genuine interest in this topic so I’ve offered to write a blog post (or perhaps a series of posts) explaining the implementation in more detail and with actual code snippets. To summarize what I spoke about;
I gave an overview on the basics of taking payments online, specifically;
I explained each core method implemented in an ActiveMerchant billing gateway class, and I covered the important design decisions I took before building in recurring billing;
Finally I talked about some pain points you’ll likely to come across when working with recurring billing and online payments in general. I hope everyone enjoyed the talk and I’d be happy to answer any further questions if you have them.
Ps. Apologies for the VGA cable problems, thanks to Declan’s trusty netbook we got there in the end!
As many of you know, I got engaged last year, and plans are under way for our wedding to be held in Tuscany, this September. Over Christmas I got to finish building our wedding website, septemberthethird.com. Hopefully it will help our guests in making travel arrangements and booking accommodation.
I stuck with a single, scrolling page design (to keep things simple) that also works well on mobile devices. For those interested, the site is built with;
(We’re even sending our Save the date messages using MailChimp!)
I do a lot of work with subdomains, managing them locally on my development and test machines has always been a bit of a pain. Going way back, I can remember manually editing the hosts file in system32\drivers\etc\ on Windows! On the Unix we have /etc/hosts.
Unfortunately /etc/hosts doesn’t allow wildcard definitions for subdomains, so you have to manually specify each one. For a while I used this simple bash script to append a new domain (or subdomain) to the /etc/hosts file;
#!/bin/bash
SUBDOMAIN=$1
TLD=$2
if [ $# -lt 1 ]
then
echo "which subdomain?"
read SUBDOMAIN
if [ -n "$SUBDOMAIN" ]
then
SUBDOMAIN="$SUBDOMAIN."
fi
fi
if [ $# -lt 2 ]
then
echo "which tld?"
read TLD
fi
echo "127.0.0.1 $SUBDOMAIN$TLD" >> /etc/hosts
echo "OK, added 127.0.0.1 $SUBDOMAIN$TLD to /etc/hosts"
Save this script as executable somewhere in your PATH, call it something like addhost then run it from anywhere like so;
> addhost # will prompt for subdomain, tld (leave blank for no subdomain)
> addhost www test.com
This soon became tiresome, with some apps requiring 10’s or 100’s of subdomains to be tested and available locally. So I took to writing a simple rake task that would automatically pull subdomain names from an applications database and append them to my local /etc/hosts file (here’s that script).
Time passed and my script worked well, but had a some disadvantages. I had to re-run it every-time my subdomain data changed, and across apps it required modified since I had different ways and means of defining subdomain sites.
Enter the most excellent suggestion from Tim Pope. Using DNS to solve this problem means no more hassle! He set up a localhost wildcard, pointing *.smackaho.st at 127.0.0.1. Essentially this means that [anything].smackaho.st will point to your local machine. Not happy with smackaho.st? lvh.me does the same thing (lvh, as in local virtual host). Or since most developers have a couple of old domains lying dormant, why not use one for this? I learned of Tim’s technique through the Subdomains in Rails 3 screen-cast from Ryan Bates.
So I think that wraps up all my posts on subdomains, whats that? four now!? Here are the other three.
Hello 2011! Who knows what this year will have in store for me. I’ve set myself a few resolutions, one of them being ‘take more notes’ (while learning, reading, coding etc.) I keep an online wiki for these things, but recently it has gotten a little stale.
So, in some spare time over Christmas I managed to move (and clean out) what was an aging, badly formatted, self-hosted MediaWiki, into something a little nicer, a GitHub wiki repository. Now I have version control goodness from Git, formatting and pages through Gollum and web hosting provided by GitHub.com.
Gollum is the real star here; it’s a Ruby/Git-powered wiki engine operating on static files in a simple folder structure. I can even run it locally (for the odd-time github goes down). With all this in place it should be easier for me to take notes than not.
Caroline (my sister) & Colin's wedding day. Thanks to Simon for putting this together. (photos)