I love it when really fantastic events happen in the north, especially because I’m based in Leeds and have ties to the North East, so I’m very excited to be speaking. Tickets go on sale in the New Year and I hope I’ll see lots of you at the Sage on 8th June!
Tag Archives: tech
OAuth Google API for Unregistered Applications
To make this work, when you sign your OAuth request Google will accept some default values for consumer key and secret – see their documentation on signing oauth requests. To do this, set both consumer key and secret to the value “anonymous”, and proceed as you normally would. The only difference so far as I can see is that the user will be shown a more cautious message when they are prompted to grant access to your application. Personally I think this is a great approach, particularly when prototyping ideas. Registering the applications though is simple and quick so I’d recommend registering for most applications once they get beyond concept stage.
Skills Analysis for Teams
256 Colours in Vim
Touring Colours in Vim
Please excuse the all-over-the-place spelling in this post, I’m British so “colour” is a word and “color” is a vim command. Confused? Me too
I grabbed two fantastic scripts – the Vim Color Sampler Pack and the rather awesome ScrollColors plugin which allows you to cycle through all your colorschemes and try them out.
Curl and Cookies
-c to Save a Cookie
Pass the -c switch followed by a filename and curl will write the cookies to a file. This is the “cookie jar” and you can dip into it whenever you want to send the cookies back with a future request. For example:
curl -c cookies.txt http://www.lornajane.net
This writes a file named cookies.txt to the local directory. When I look in it, it contains:
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
www.lornajane.net FALSE / FALSE 0 s9y_4e071c5ccc553288993faf0369cb076c 539e01676501366ea0f04e2646b1a31d
-b to Send Cookies
All I do when I want to use the cookie on future requests is pass exactly the same command but with a -b switch; this will read the named file and send the cookies along. You can edit the cookies as you wish, at your own risk of course, and this makes the use of cookies and curl an absolutely invaluable technique for testing! It’s also common to use it on sites where you want to download a file directly to the server but the site requires login first.
Is Enum Evil?
There are cases where an enum is the correct choice for a particular type of data, so let’s look at what an enum type actually is and does.
Return on Investment: Example
Imagine the scenario where, given 3 days to work on it, a developer can get the deployment time for their code down from 3 hours to 20 minutes. This company does, on average, 42 deployments per year (you can guess these numbers are totally imaginary).
So 3 days at 7.5 hours per day means we are investing 22.5 hours on this.
The return is the difference between the deployments, multiplied by the number of deployments that are needed. So 3 hours is 180 minutes – so we save (180 – 20) = 160 minutes with each deploy. We do that 42 times in a year so we’ve saved 6720 minutes (per year) which is 112 hours or 14.9 days.
Project managers might not like to lose 3 days from their schedule but how do they feel about having a spare 3 weeks each year?
My Three Favourite Opera Features
Missing pcre.h when installing pecl_oauth
Error: /usr/include/php5/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
I didn’t have the header files for pcre installed – in ubuntu the headers are in the -dev packages so I just installed what I needed:
sudo aptitude install libpcre3-dev
Re-attempting the pecl install, everything worked as expected. This is on Ubuntu 10.04 Lucid Lynx, and from reading around you’d want to install the same package in response to this error message, regardless of what you were doing to cause it. Hope this helps someone.