2014-10-08T20:48:02+01:00http://www.leepa.io/Octopress2014-06-01T11:07:00+01:00http://www.leepa.io/2014/06/01/vim-all-the-thingsI probably spend way too much time configuring my VIM setup. It tends to
change depending on what I’m working on. So, at the moment the following
things matter to me most:

There would be Scala, but I use the excellent IntelliJ IDEA product for
that. Nothing can beat it, so there’s no point trying to get VIM to do it.

It matters to me that my editor works cross platform too. Not fussed so much
about VIM on Windows (although it’s nice when that works too) but more
between OSX and Linux as they are the main two Operating Systems I use.

So I felt I’d do a post about how I manage my VIM config as it may/may not
be useful for others.

setnocompatible" be iMproved, requiredfiletype off " required" set the runtime path to include Vundle and initializesetrtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()"
" let Vundle manage Vundle, requiredPlugin 'gmarik/Vundle.vim'" Your stuff is going go here..." All of your Plugins must be added before the following linecall vundle#end()" requiredfiletype plugin indent on" required

Now we have a basis of a working VIM we can work on. Let’s set up some cool
stuff now…

Some obvious bootstrap things

By default, VIM likes to behave a little bit old fashioned. We want some
niceties from the off - so let’s do that:

1234567891011121314151617181920212223242526

setexpandtab" Soft tabs all the thingssettabstop=2" 2 spaces is used almost everywhere nowsetshiftwidth=2" When using >> then use 2 spacessetautoindent" Well, obviouslysetsmartindent" As opposed to dumb indentsetnoautowritesetnumbersetautoread" Read changes from underlying file if it changessetshowmode" Showing current mode is helpful++setshowcmdsetnocompatible" Actually make this vimsetttyfast" We don't use 33.6 modems these dayssetrulersetincsearch" Use incremental search like OMG yessetignorecase" Ignore case when searchingsethlsearch" Highlight searchingsetshowmatch" Show me where things matchsetdiffopt=filler,iwhite "Nice diff optionssetshowbreak=↪ " Cooler linebreaksetnoswapfile" It's 2014, GO AWAY FFSsetesckeys" Allow escape key in insert modesetcursorline" Highlight the line we're onsetencoding=utf8 " Really, people still use ASCII

You’ll notice that 2 spaces is the default but, obviously, Python is a good
example of a language that uses 4.

1

auFileType python setlocaltabstop=8expandtabshiftwidth=4softtabstop=4

This way you’ll see, we get to customise each language. It’s nice. ‘au’ is
short for auto. As in… Automatically run this when the FileType is python.

Syntastic

This is the Batman utility belt. It’s also easy to set up and serves as a
good example of how Vundle works.

1

Bundle 'scrooloose/syntastic'

Job done. Make sure this goes between the Vundle begin and end calls.

Now save that and we’ll online reload/install:

1

vim -c "execute \"BundleInstall\" | q | q"

This will load up vim, install all the things and then exit when done.

Part One Done

I was going to write this in one post - but I changed my mind when this
started taking a lot longer to write than I wanted.

Next part, I’ll focus on setting Syntastic with Python and how to make
vim-go the setup you want for managing Go projects.

]]>2014-02-02T11:28:00+00:00http://www.leepa.io/2014/02/02/fosdem-2014Just spent the weekend at FOSDEM 2014. It’s the
first time I have been to FOSDEM and checked out more of the Open Source
world.

Seven of us went from Green Man Gaming and the only thing I will remember
for the future is that I need to turn up to talks I want to go to very much
in advance.

Rooms were always very quickly packed out. Managed to meet lots of cool
and awesome people though.

Go was the language of the conference

There’s no way you could avoid this. Go is mainstream
now. It’s been heading this way for a while - but it’s very clear that this
language that people wondered the point of is now relevant to the point of
obsession. The room was constantly ram packed and people staying for talk
after talk.

I’m not the only one that laughs at MongoDB

Yep, turns out lots of people find the stability amusing.

There tons of PostgreSQL I don’t know

This was always going to be a given. The RDBMS is still relevant and still
attracting a lot of attention. There was a definite lack of MySQL and MariaDB
however. Maybe that swings it a bit.

There’s loads of stuff coming in 9.4.x for JSON and the like. The main thing
I got from the talks though was an understanding of TOAST.

I need to do more here

Next year… I need to make more of an effort to plan and attend more talks.

I will be here next year!

]]>2012-12-15T20:34:00+00:00http://www.leepa.io/2012/12/15/making-http-client-calls-with-finagleI was trying to make HTTP calls using Finagle today and all I would get was
this traceback from my logs:

The important bits, that don’t appear well documented are tcpConnectTimeout
and requestTimeout. The normal ‘timeout’ usually used on the ClientBuilder is
not what you want.

This was more a note for me - but figured people Googling might find it useful
also.

]]>2012-07-07T08:27:00+01:00http://www.leepa.io/2012/07/07/write-code-like-you-mean-itRecently I was catching up on talks from DjangoCon EU 2012. Wish I could have been there. This talk on Flasky Goodness (or, why Django sucks) sort of rang a bell with me.

Why? Well, for me the point of writing everything like it’s going to be open source seems like a great way of doing things. It’s a great philosophy to have. Seriously.

]]>2011-10-02T22:16:48+01:00http://www.leepa.io/2011/10/02/dont-bother-with-that-degree-say-it-prosInteresting tidbit posted by The Register last week. It’s a topic fairly close
to my heart as I don’t have a degree. I do, weirdly, get asked about this
quite a bit - “should I get a degree?”. If you think you should, you should.
Don’t let any “IT pro” sway your decision.

This is especially important now that degrees are just so damned expensive.
According El’Reg, you’re looking at £27k for your degree. Wow!

Personally, when I look at people’s CVs, the first thing I’ll do is Google
them. Then, I’ll take a look at their Github profile. Then I look at their
education. It’s important that if they did a degree, they did well - but it
doesn’t matter if they didn’t do one at all.

]]>2011-07-03T14:10:00+01:00http://www.leepa.io/2011/07/03/always-give-credit-where-credit-is-dueA few people spring to mind who this applies to. They know who they are.

]]>2011-07-02T13:07:34+01:00http://www.leepa.io/2011/07/02/git-squashing-commits-without-merging-a-thingThis trick has saved me today and I’ve had to use it before… so I’m going to
demonstrate how to do this here in my own words to save me Googling for every
time!

So imagine the scenario. You’ve done a load of commits and you’re not ready to
merge them back into master (or, even worse you’re in master) and you realise
you made a massive mistake a few commits back and you need to just squash all
the correction commits into it:

Well that’s crap really isn’t it? So how do we go about sorting this? Well, we
make a good use of rebase and tags to achieve this. There’s a nice answer to
this on Stack Overflow - but I’ll replay it here.
Props to Charles Bailey
for this process.

So, here’s how we fix this:

12345678910111213141516

# Checkout the top commit in a detached branch git checkout
6e0fa1b21e760aee2391f73c4905244a229abe8b
# Now, do a soft reset back to the original commit git reset --soft
caefc1c0a8903009af2be8cd37df1ac40366fcce
# Now commit --amend it to squash it all git commit --amend
# Then, tag this new detached commit git tag tmp
# Now go back onto master git checkout master
# Awesome now do a quick rebase and it'll replace the upstream with tmp git
rebase --onto tmp 6e0fa1b21e760aee2391f73c4905244a229abe8b
# No need for tmp now git tag -d tmp

Not overly simple - but brings, in this case, master to where I wanted it to
be!

]]>2011-06-17T23:20:53+01:00http://www.leepa.io/2011/06/17/making-qt-webkit-and-macdeployqt-workWhen making a Webkit app with Qt, bundling a
.app will not work. Ok, so that’s not quite true - but it won’t run. This is a
build bug on the Qt side - fixable with a small post-bundle step:

This will mean your app will no longer crash - so fairly useful.

]]>2011-05-29T11:12:20+01:00http://www.leepa.io/2011/05/29/moved-domains-for-the-blogI got bored of leenux.org.uk as a domain name. So I’ve moved everything to leecutsco.de - I think it looks cooler - and also leenux was only bought as a joke. I’m a sucker for domain names… I actually own over 20. The annual bill for that is redonkulous (grr @helenmoyes has me addicted to that word now).

I’ve kept my e-mails the same, for now, however - leenux.org.uk has been my primary domain for nearly a decade (10 years this November), so I’ll have to keep it running regardless. This’ll just be the blog for now.

]]>2011-05-26T10:57:51+01:00http://www.leepa.io/2011/05/26/tweetdeck-joins-the-twitter-flockThe last week has been, as I’m sure you can imagine, hectic. It’s all out the
bag now - TweetDeck has been acquired by
Twitter. It’s absolutely amazing news and I’m really
proud to be a part of it. As part of the deal, my employment, along with the
entire team, has transferred over to Twitter.

I came along fairly late in the day in all this having only joined in January
of this year. I never guessed that by now I’d be working for Twitter as a
Software Engineer. I’m totally stoked.

I’ll still be working on mobile clients - and hopefully I’ll get more time to
work on Chrome hacks.

So, congratulations everyone! Special congratulations to Iain… it proves
that scratching an itch really can lead you down paths you never expect. Let
this be a lesson to Software Engineers / Programmers everywhere.

This is why you should always be careful what you throw in the trash. ALWAYS SHRED YOUR STUFF. This guy, and a guy on the other side of the road, systematically working their way up said road scavenging.

]]>2011-05-11T17:31:59+01:00http://www.leepa.io/2011/05/11/hackday-native-tweetdeckHere’s what I made during today’s HackDay @ TweetDeck. Our illustrious leader
is uploading the rest now on the @iaindodsworth YouTube
page.
]]>2011-04-29T15:29:01+01:00http://www.leepa.io/2011/04/29/grrr-i-broke-the-short-url-linkNo biggy. Was updating the blog this morning and hit Update Framework. Of
course, that blats my custom change for doing leepa.co links on the short URL
link below each post. I will fix it later.
]]>2011-04-29T09:59:28+01:00http://www.leepa.io/2011/04/29/techcrunch-give-tweetdeck-for-ios-a-flyVery proud of this. TechCrunch do a Fly or Die review of the TweetDeck for
iOS that I’ve
been working on at TweetDeck for the last 3 months. They give it a fly.

The new TweetDeck for iPhone still lets you add as many columns as you want
and swipe through to view different streams, but you also get a unified Home
column, which can combine your Twitter and Facebook streams into one. The app
has nice subtle touches, such as the diagonal swipe to see more Tweets from
the same account (my favorite). And instead of timestamps cluttering each
Tweet, the timestamp changes at the top as you scroll through your stream. If
you want to jump to the top to the most recent Tweet, just tap the actual time
(yeah, someone had to point that one out to me too, but these are the kinds of
hidden features power users love).

]]>2011-04-28T10:06:00+01:00http://www.leepa.io/2011/04/28/ps3-it-only-does-identity-theftWARNING: There is swearing in this - but it’s also awesome.
]]>2011-04-28T07:37:47+01:00http://www.leepa.io/2011/04/28/windows-update-failGot the Windows Update reboot loop of death this morning. You know, where it
fails to install updates and rolls back. To fix…

Uncheck ﻿KB982018 and install all other updates

Reboot

Install KB982018 on its own

Reboot
And you’re done.

Yes, really, it’s that stupid. Enjoy!

]]>2011-04-20T22:34:43+01:00http://www.leepa.io/2011/04/20/wtb-photos-in-the-iphone-simulatorSimple but not obvious.

Load up simulator

Grab a finder window

Drag jpg/png into iPhone Simulator window

It’ll open up Safari

Long click on Image

Save Image

(If this is the first time on this emulator) Long click on Image and Save Image again
This way you can use the picker and everything. Great. Better than the
solutions of random folders in ~/Library I think

]]>2011-04-08T08:06:44+01:00http://www.leepa.io/2011/04/08/dropbox-authentication-insecure-by-designI have tested this, and can back up what Derek is saying. It is more than a
little worrying - but also easy for the Dropbox guys to fix.