<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 <title>Pete Hamilton</title>
 <link href="http://pete-hamilton.co.uk/atom.xml" rel="self"/>
 <link href="http://pete-hamilton.co.uk/"/>
 <updated>2014-05-08T15:32:20+01:00</updated>
 <id>http://pete-hamilton.co.uk/</id>
 <author>
   <name>Pete Hamilton</name>
   <email>peterejhamilton+hi@gmail.com</email>
	 <uri>http://pete-hamilton.co.uk</uri>
 </author>
 
   <entry>
     <title>Scaling Heroku by Time of Day</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2014/05/08/scale-heroku-by-time-of-day/"/>
     <updated>2014-05-08T15:00:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2014/05/08/scale-heroku-by-time-of-day</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;Heroku is brilliant. However, I manage a rails application which has grown much larger recently. It’s a bespoke company-specific application so it’s only used during working hours. There are therefore long periods of time (at night, over the weekend) where I’m paying for dynos which simply aren’t going to get used.&lt;/p&gt;

&lt;blockquote&gt;
All dynos in your application that are scaled above 0 will accrue usage–regardless of whether they’re actually receiving or processing requests
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://devcenter.heroku.com/articles/usage-and-billing#computing-usage&quot;&gt;https://devcenter.heroku.com/articles/usage-and-billing#computing-usage&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://devcenter.heroku.com/articles/usage-and-billing#cost&quot;&gt;https://devcenter.heroku.com/articles/usage-and-billing#cost&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;https://addons.heroku.com/adept-scale&quot;&gt;Adept Scale&lt;/a&gt; offers a solution which automatically scales but I know when my load is high and low, also it’s fairly consistent within working hours.&lt;/p&gt;

&lt;p&gt;For fun, I decided to see if I could scale my heroku dynos by time period. Turns out it’s really easy.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;Note: I use heroku’s scheduler combined with rake tasks below, but this could easily be done with scheduled jobs. If you have any trouble, comment and I’ll do my best to help you out.&lt;/em&gt;&lt;/p&gt;

&lt;h2 id=&quot;add-the-heroku-api-gem&quot;&gt;Add the heroku-api gem&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;gem&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;heroku-api&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;decide-on-limits-and-set-them-in-your-heroku-config&quot;&gt;Decide on limits and set them in your Heroku config&lt;/h2&gt;

&lt;p&gt;For a simple small application you might have something like:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HEROKU_WEB_HIGH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HEROKU_WEB_LOW&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HEROKU_WORKER_HIGH&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;HEROKU_WORKER_LOW&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-rake-tasks-for-scaling-updown&quot;&gt;Add rake tasks for scaling up/down&lt;/h2&gt;

&lt;p&gt;I also add logic to prevent scaling up if it’s the weekend&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:scale_up&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:environment&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;saturday?&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;today&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sunday?&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Heroku&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:API&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post_ps_scale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;YOUR_APP_NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;web&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;HEROKU_WEB_HIGH&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post_ps_scale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;YOUR_APP_NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;worker&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;HEROKU_WORKER_HIGH&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;task&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:scale_down&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:environment&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;Heroku&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:API&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post_ps_scale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;YOUR_APP_NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;web&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;HEROKU_WEB_LOW&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;heroku&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;post_ps_scale&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;YOUR_APP_NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;worker&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;HEROKU_WORKER_LOW&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;deploy&quot;&gt;Deploy&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;git push heroku master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-the-heroku-schedulerhttpsaddonsherokucomscheduler-addon&quot;&gt;Add the &lt;a href=&quot;https://addons.heroku.com/scheduler&quot;&gt;Heroku Scheduler&lt;/a&gt; addon&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;heroku addons:add scheduler
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-heroku-scheduler-tasks&quot;&gt;Add Heroku Scheduler Tasks&lt;/h2&gt;

&lt;p&gt;Visit the heroku scheduler dashboard and add your rake tasks.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Add &lt;code&gt;rake scale_up&lt;/code&gt; in the morning e.g. 8:00 am&lt;/li&gt;
  &lt;li&gt;Add &lt;code&gt;rake scale_up&lt;/code&gt; in the evening e.g. 7:00 pm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/img/post_images/heroku-scale/scheduler.png&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;extensions&quot;&gt;Extensions&lt;/h2&gt;

&lt;p&gt;You could add gems like &lt;a href=&quot;https://github.com/alexdunae/holidays&quot;&gt;holidays&lt;/a&gt; to run in your rake tasks and help prevent scaling up on public holidays as well as just the weekends.&lt;/p&gt;

&lt;p&gt;You could also add more scheduled tasks throughout the day, or just have one task which runs more frequently and performs the logic of scaling up/down within it. It’s up to you!&lt;/p&gt;

&lt;h2 id=&quot;what-could-we-save&quot;&gt;What could we save?&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Assume the app is only used 8:00am - 7:00pm&lt;/li&gt;
  &lt;li&gt;Assume high = 20 paid web dynos, 10 paid worker dynos.&lt;/li&gt;
  &lt;li&gt;Assume low = 0 paid web dynos, 0 paid worker dynos (one free web dyno)&lt;/li&gt;
  &lt;li&gt;In the UK, there are 253 working days in 2014&lt;/li&gt;
  &lt;li&gt;Dynos are $0.05/h, prorated to the second&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text&quot;&gt;Before: $0.05 * 30 dynos * 24 hours * 365 days = $13140
After: $0.05 * 30 dynos * 13 hours * 253 days = $4993.50
Savings: ~ $8000 a year!

Per Dyno Time: 8760 vs 3298 hours per year. Quite a difference.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In fact, I could more than double my number of operating dynos using this method and still save money.&lt;/p&gt;

&lt;h2 id=&quot;disclaimer&quot;&gt;Disclaimer&lt;/h2&gt;

&lt;p&gt;There are a number of cases where obviously this simply isn’t logical, for example if your application is used in multiple timezones or needs to handle unexpected traffic spikes. However if you know your requirements and they match mine, this could be pretty helpful at helping you keep your application usable without breaking the bank.&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Skype Phone+Voicemail Sucks</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2014/03/19/skype-phone-voicemail-sucks/"/>
     <updated>2014-03-19T12:30:00+00:00</updated>
     <id>http://pete-hamilton.co.uk/2014/03/19/skype-phone-voicemail-sucks</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;I was recently helping someone set up a business phone number such that they could make and receive calls from their mobile and not be limited to (or have to pay for) a physical landline.&lt;/p&gt;

&lt;p&gt;I chose Skype, which I’m not sure was a great idea any more. I was originally intending to build something with &lt;a href=&quot;http://www.twilio.com&quot;&gt;Twilio&lt;/a&gt; but exams are coming up so I’ve banned all side projects for now. I just needed something simple.&lt;/p&gt;

&lt;p&gt;I got a phone number set up on their account no problem and a quick check-list of the simplest requirements then went like this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Call number when signed in - goes through to various devices fine.&lt;/li&gt;
  &lt;li&gt;Call number when offline - calls go to Skype voicemail&lt;/li&gt;
  &lt;li&gt;Call number but decline call - Call gets a busy signal till you hang up&lt;/li&gt;
  &lt;li&gt;Call number and leave the call - Call rings out until after a few minutes you get a busy signal till you hang up&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those last two are &lt;strong&gt;ridiculous&lt;/strong&gt;. Anyone calling a normal phone number expects to either:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Be answered&lt;/li&gt;
  &lt;li&gt;Go to voicemail immediately (if person is engaged or can’t answer)&lt;/li&gt;
  &lt;li&gt;Go to voicemail after a while (if person isn’t around)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How Skype expects anyone to take their offering seriously without those last two is a mystery to me. After some digging however, I did manage to get some way to solving point &lt;strong&gt;2&lt;/strong&gt; above.&lt;/p&gt;

&lt;p&gt;In the desktop app (I’m on a Mac), in Skype’s preferences:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Select the &lt;code&gt;Calls&lt;/code&gt; panel&lt;/li&gt;
  &lt;li&gt;Select &lt;code&gt;Send to voice messages&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Click &lt;code&gt;Set up voice messaging&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Tick &lt;code&gt;Send declined calls to voice messages&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/img/post_images/skype/skype-1.png&quot; /&gt;
&lt;img class=&quot;center&quot; src=&quot;/img/post_images/skype/skype-2.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On mobile it doesn’t seem you can enable this option. Why Skype, WHY?&lt;/p&gt;

&lt;p&gt;Also, if you reject a call on your desktop while your mobile is signed in, it won’t send the call to voicemail but continue ringing on your phone, if you then reject it there, it goes straight to the busy tone as before.&lt;/p&gt;

&lt;p&gt;I’m &lt;a href=&quot;http://community.skype.com/t5/Android/Rejected-call-goes-to-busy-signal-rather-than-VM/td-p/1805080&quot;&gt;not the only one&lt;/a&gt; who’s discovered this.&lt;/p&gt;

&lt;p&gt;If you have a better alternative to Skype for a simple UK business phone number setup, I’d love to hear it in the comments below.&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>ICHACK &#39;14 - Hackathon Survival Tips</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2014/03/07/ichack-prep-session/"/>
     <updated>2014-03-07T16:00:00+00:00</updated>
     <id>http://pete-hamilton.co.uk/2014/03/07/ichack-prep-session</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;What with &lt;a href=&quot;http://ichack.org&quot;&gt;ICHACK ‘14&lt;/a&gt; coming up this weekend, I did a short presentation to the attendees with some pre-event hints and tips to help them hit the ground running.&lt;/p&gt;

&lt;script async=&quot;&quot; class=&quot;speakerdeck-embed&quot; data-id=&quot;cf1acb5086ef01317a0e4eb1fffb7582&quot; data-ratio=&quot;1.33333333333333&quot; src=&quot;//speakerdeck.com/assets/embed.js&quot;&gt;&lt;/script&gt;

</content>
   </entry>
 
   <entry>
     <title>O2 Blocking Childline, NSPCC under &#39;Parental Control&#39; Policy?</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/12/21/o2-block-childline-nspcc/"/>
     <updated>2013-12-21T20:30:00+00:00</updated>
     <id>http://pete-hamilton.co.uk/2013/12/21/o2-block-childline-nspcc</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;After playing with O2’s &lt;a href=&quot;http://urlchecker.o2.co.uk/urlcheck.aspx&quot;&gt;URL checker&lt;/a&gt; someone pointed out earlier that they seem to be blocking sites like &lt;a href=&quot;http://www.childline.org.uk&quot;&gt;Childline&lt;/a&gt; and the &lt;a href=&quot;http://www.nspcc.org.uk&quot;&gt;NSPCC&lt;/a&gt; under the ‘Parental Control’ filter. I’ve just checked again and it’s still the case.&lt;/p&gt;

&lt;p&gt;I (and no doubt many others) think this is pretty awful. Charities dedicated to helping children who might be experiencing abuse are being blocked from those children under the ‘parental control’ policy. What?&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en-gb&quot;&gt;&lt;p&gt;&lt;a href=&quot;https://twitter.com/O2&quot;&gt;@O2&lt;/a&gt; it appears you block &lt;a href=&quot;https://twitter.com/NSPCC&quot;&gt;@nspcc&lt;/a&gt; and &lt;a href=&quot;https://twitter.com/childline&quot;&gt;@childline&lt;/a&gt; for children under “Parental Control”. &lt;a href=&quot;http://t.co/JSlh2MWG6o&quot;&gt;http://t.co/JSlh2MWG6o&lt;/a&gt; what!? &lt;a href=&quot;http://t.co/cCa9AwbYVg&quot;&gt;pic.twitter.com/cCa9AwbYVg&lt;/a&gt;&lt;/p&gt;&amp;mdash; Peter Hamilton (@peterejhamilton) &lt;a href=&quot;https://twitter.com/peterejhamilton/statuses/414487703733174272&quot;&gt;December 21, 2013&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;I understand these things sometimes slip through unchecked and I may even be completely misunderstanding what the URL checker results really mean, but on the off chance that someone somewhere has messed up and children are being prevented access to sites which are there to help them, I hope this post might help get the sites unblocked.&lt;/p&gt;

&lt;p&gt;It seems that you can suggest reclassification of a site so if anyone sees this before O2 update their parental control filters I suggest you put a request in. To do so:&lt;/p&gt;

&lt;hr /&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;http://urlchecker.o2.co.uk/urlcheck.aspx&quot;&gt;Visit O2’s URL checker&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Enter the charity site(s)
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;http://www.childline.org.uk&quot;&gt;http://www.childline.org.uk&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://www.nspcc.org.uk&quot;&gt;http://www.nspcc.org.uk&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;http://www.itgetsbetter.org/&quot;&gt;http://www.itgetsbetter.org&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Click &lt;strong&gt;continue&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;At the bottom where it says &lt;em&gt;“If you think this website needs a different policy, click here”&lt;/em&gt; click &lt;strong&gt;continue&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;p&gt;Oddly it seems that &lt;a href=&quot;https://www.gov.uk/&quot;&gt;GOV.UK&lt;/a&gt; is also blocked along with pretty much anything else I search for. I’m wondering what logic has been applied to this parental control filter and whether it’s an over zealous list or maybe just blocks everything unless the parent unblocks it? Even if that’s the case, I find the idea that a parent could even opt-in to have an abuse website blocked just as terrible as the fact that O2 seem to have blocked the sites by default. In my personal opinion such sites should be supported fully and be immune from being blocked, even on an opt-in basis.&lt;/p&gt;

&lt;p&gt;It seems O2 aren’t the only ones. Earlier this week BT took some flack from the BBC for similar reasons, specifically regarding for their guidelines on porn and sexuality, according to the &lt;a href=&quot;http://www.bbc.co.uk/news/uk-25430582&quot;&gt;original BBC article&lt;/a&gt;, they were blocking sites including &lt;a href=&quot;http://www.sexualhealthscotland.co.uk/&quot;&gt;Sexual Health Scotland&lt;/a&gt;, &lt;a href=&quot;http://host22.qnop.net/~doncaste/&quot;&gt;Doncaster Domestic Abuse Helpline&lt;/a&gt;, &lt;a href=&quot;http://www.reducingtherisk.org.uk/cms/&quot;&gt;Reducing The Risk&lt;/a&gt; (a site which tackles domestic abuse) and &lt;a href=&quot;http://www.ewrasac.org.uk/&quot;&gt;Edinburgh Women’s Rape and Sexual Abuse Centre&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These new filters which a lot of major UK ISPs are implementing in the coming months/year seem well meaning and will undoubtedly have a few teething problems, but they need to either do a better job of classifying sites in the first place, or have a very clear and easy mechanism by which people can help re-classify wrongly blocked sites. If they don’t I can only see this getting worse.&lt;/p&gt;

</content>
   </entry>
 
   <entry>
     <title>Society Newsletters powered by Node.js</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/11/07/society-newsletters-nodejs/"/>
     <updated>2013-11-07T10:00:00+00:00</updated>
     <id>http://pete-hamilton.co.uk/2013/11/07/society-newsletters-nodejs</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;Last year when I was secretary of &lt;a href=&quot;http://www.docsoc.co.uk&quot;&gt;Imperial College’s Computing Society&lt;/a&gt; or DoCSoc) we decided to clean up the amount of email we sent to students, compiling everything into a weekly newsletter. The mailing list is internal to university, so sending a pretty email using something like Mailchimp or Campaign Monitor is basically impossible.&lt;/p&gt;

&lt;p&gt;At the time, I created a quick &lt;a href=&quot;https://github.com/petehamilton/digest-email&quot;&gt;digest-email&lt;/a&gt; rubygem which took a &lt;a href=&quot;https://gist.github.com/4092848&quot;&gt;YAML file&lt;/a&gt; containing all the news items, a basic html template, css file and process it all to produce html for the email. It was a pretty neat project and saved me a tonne of time. People contributed their YAML snippets and I just pressed “GO”.&lt;/p&gt;

&lt;p&gt;This year, I wanted to continue using this newsletter style of communication. However I wanted to try something new technology-wise, so I’ve created a similar tool but using completely different technologies.&lt;/p&gt;

&lt;p&gt;All email content is done in &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax&quot;&gt;Markdown&lt;/a&gt;, your templating is done in &lt;a href=&quot;http://jade-lang.com/&quot;&gt;Jade&lt;/a&gt;, your CSS in &lt;a href=&quot;http://learnboost.github.io/stylus/&quot;&gt;Stylus&lt;/a&gt; and &lt;a href=&quot;http://nodejs.org/&quot;&gt;NodeJS&lt;/a&gt; then pulls it all together, pushes it through &lt;a href=&quot;https://github.com/LearnBoost/juice&quot;&gt;Juice&lt;/a&gt; to inline all the CSS for email compatibility and outputs it to an HTML file.&lt;/p&gt;

&lt;p&gt;You can see more on the project &lt;a href=&quot;https://github.com/icdocsoc/digest-emails&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The obvious advantage is that people can design templates and CSS as they would normal webpages, albeit with &lt;a href=&quot;http://campaignmonitor.cachefly.net/assets/files/css/campaign-monitor-guide-to-css-in-email-sep-2013V2.pdf?ver=1407&quot;&gt;a few caveats&lt;/a&gt; for HTML emails&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;left&quot; src=&quot;/img/post_images/digest-email/digest-email-inputoutput.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Whilst this is similar to the ruby version, this project does a few nifty things like extracting primary headers automatically and using them to create an automatic agenda at the top of the newsletter.&lt;/p&gt;

&lt;p&gt;This was just for fun, but who knows, maybe someone else will find it useful. From my point of view, it was just fun to play with NodeJS for the first time properly. If I’ve done something boneheaded and evidently just don’t understand javascript, please do comment below ;)&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Stubborn Jekyll Deployments</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/10/25/stubborn-jekyll-deployment/"/>
     <updated>2013-10-25T10:00:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2013/10/25/stubborn-jekyll-deployment</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Seems it may have been a problem with &lt;a href=&quot;https://github.com/laurilehmijoki/filey-diff&quot;&gt;Filey-Diff&lt;/a&gt;, I just did a &lt;code&gt;bundle update&lt;/code&gt; (can’t work out how I did) and it bumped the version significantly.&lt;/p&gt;

&lt;p&gt;Old grumpy post below for posterity…&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;I use the &lt;a href=&quot;https://github.com/laurilehmijoki/s3_website&quot;&gt;s3_website&lt;/a&gt; gem to deploy this blog.&lt;/p&gt;

&lt;p&gt;However, for some reason, the occasional file (not the same one every time I don’t think) causes either the filey-diff or AWS gem to bomb out with the below:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;Deploying _site/* to pete-hamilton.co.uk
/Users/MY_USER/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/openssl/buffering.rb:174:in &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;sysread_nonblock&lt;span class=&quot;s1&quot;&gt;&amp;#39;: end of file reached (EOFError)&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  from /Users/MY_USER/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/openssl/buffering.rb:174:in `read_nonblock&amp;#39;&lt;/span&gt;
  from /Users/MY_USER/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/net/protocol.rb:141:in &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;rbuf_fill&lt;span class=&quot;s1&quot;&gt;&amp;#39;&lt;/span&gt;

&lt;span class=&quot;s1&quot;&gt;  ...&lt;/span&gt;

&lt;span class=&quot;s1&quot;&gt;  etc&lt;/span&gt;

&lt;span class=&quot;s1&quot;&gt;  ...&lt;/span&gt;

&lt;span class=&quot;s1&quot;&gt;  from /Users/MY_USER/Projects/blog/.bundle/gems/aws-sdk-1.8.5/lib/aws/s3/s3_object.rb:313:in `last_modified&amp;#39;&lt;/span&gt;
  from /Users/MY_USER/Projects/blog/.bundle/gems/filey-diff-1.2.1/lib/filey-diff/data-sources/aws_sdk_s3.rb:61:in &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;last_modified_and_md5&lt;span class=&quot;s1&quot;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  from /Users/MY_USER/Projects/blog/.bundle/gems/filey-diff-1.2.1/lib/filey-diff/data-sources/aws_sdk_s3.rb:48:in `map_s3_object_to_filey&amp;#39;&lt;/span&gt;
  from /Users/MY_USER/Projects/blog/.bundle/gems/filey-diff-1.2.1/lib/filey-diff/data-sources/aws_sdk_s3.rb:13:in &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;block in do_internal_load&lt;span class=&quot;s1&quot;&gt;&amp;#39;&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;  from /Users/MY_USER/Projects/blog/.bundle/gems/filey-diff-1.2.1/lib/filey-diff/data-sources/aws_sdk_s3.rb:27:in `call&amp;#39;&lt;/span&gt;
  from /Users/MY_USER/Projects/blog/.bundle/gems/filey-diff-1.2.1/lib/filey-diff/data-sources/aws_sdk_s3.rb:27:in &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;block &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;2 levels&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; in in_parallel_or_sequentially&lt;span class=&quot;err&quot;&gt;&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I did look into it, but couldn’t see any good reason for the bomb-out.
I reinstalled all gems, tried specifying versions manually, scoured google and stack overflow but to no avail.&lt;/p&gt;

&lt;p&gt;What I did in the end was trade beauty for beligerence. I wrote a simple &lt;code&gt;deploy.sh&lt;/code&gt; file which just does the following:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
until s3_website push; do :; done
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I’d say I’m sorry for being such an awful human being, but I’m not. Sometimes getting the job done is better than getting the job done perfectly…&lt;/p&gt;

&lt;p&gt;If you have had this and worked out how to fix it, I’ll award you all my internet points, please leave a comment below!&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>London Ruby User Group Talk - Hutch</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/08/14/gocardless-hutch/"/>
     <updated>2013-08-14T10:00:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2013/08/14/gocardless-hutch</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;I recently presented a talk on a new gem we’ve written at &lt;a href=&quot;https://gocardless.com&quot;&gt;GoCardless&lt;/a&gt; called &lt;a href=&quot;&quot;&gt;Hutch&lt;/a&gt; which allows you to do really easy inter-service communication with RabbitMQ. You can read the official GoCardless blog post by our own &lt;a href=&quot;https://twitter.com/hmarr&quot;&gt;Harry Marr&lt;/a&gt; &lt;a href=&quot;https://gocardless.com/blog/hutch-inter-service-communication-with-rabbitmq/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, I did a talk on it for LRUG (London Ruby User Group). You can see the video of the talk &lt;a href=&quot;http://skillsmatter.com/podcast/design-architecture/rabbit-running-wild-you-need-a-hutch&quot;&gt;here on skillsmatter&lt;/a&gt; or view the presentation below.&lt;/p&gt;

&lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/25198711 &quot; width=&quot;600&quot; height=&quot;500&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;It seemed to go down reasonably well for a first tech talk. Now to manage it without quite so many “Umm”s.&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p&gt;For a first tech talk on a complex subject, &lt;a href=&quot;https://twitter.com/peterejhamilton&quot;&gt;@peterejhamilton&lt;/a&gt; just knocked it out of the park - very clear &lt;a href=&quot;https://twitter.com/RabbitMQ&quot;&gt;@RabbitMQ&lt;/a&gt; intro &lt;a href=&quot;https://twitter.com/search?q=%23lrug&amp;amp;src=hash&quot;&gt;#lrug&lt;/a&gt;&lt;/p&gt;&amp;mdash; Andy Piper (@andypiper) &lt;a href=&quot;https://twitter.com/andypiper/statuses/366993554532343809&quot;&gt;August 12, 2013&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

</content>
   </entry>
 
   <entry>
     <title>AngularJS + Rails with Bower</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/07/13/angularjs-and-rails-with-bower/"/>
     <updated>2013-07-13T10:00:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2013/07/13/angularjs-and-rails-with-bower</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;I really don’t like committing library code to my repos.&lt;/p&gt;

&lt;p&gt;For a project I’m hacking around on this weekend I’m using &lt;a href=&quot;http://angularjs.org/&quot;&gt;AngularJS&lt;/a&gt;, &lt;a href=&quot;http://necolas.github.io/normalize.css/&quot;&gt;Normalize.css&lt;/a&gt; and a bunch of other front end JS and CSS libraries. &lt;a href=&quot;http://bower.io/&quot;&gt;Bower&lt;/a&gt; seemed perfect to organise all of this but there wasn’t too much information out there on how to combine it with rails.&lt;/p&gt;

&lt;p&gt;So, here’s my quick guide to getting set up with front end vendor assets in rails with Bower.&lt;/p&gt;

&lt;h2 id=&quot;youll-need-to-have-bower-installed&quot;&gt;1. You’ll need to have bower installed:&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;nx&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;npm&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;bower&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;tell-bower-where-to-put-the-components&quot;&gt;2. Tell Bower where to put the components&lt;/h2&gt;

&lt;p&gt;In the root of your project, create a &lt;code&gt;.bowerrc&lt;/code&gt; file to tell bower where to install the components.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;directory&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;vendor/assets/components&amp;quot;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;tell-bower-which-components-to-install&quot;&gt;3. Tell Bower which components to install&lt;/h2&gt;

&lt;p&gt;Also create a &lt;code&gt;bower.json&lt;/code&gt; file to tell bower which components you’d like to install. See the full registry list &lt;a href=&quot;http://sindresorhus.com/bower-components/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was mine:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// bower.json&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&amp;quot;dependencies&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&amp;quot;angular-activerecord&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&amp;quot;angular-all-unstable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;s2&quot;&gt;&amp;quot;normalize-css&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;tell-rails-to-include-components-in-the-assets-pipeline&quot;&gt;4. Tell Rails to include components in the assets pipeline:&lt;/h2&gt;

&lt;p&gt;Add vendor assets components to the asset pipeline&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;&lt;span class=&quot;c1&quot;&gt;# config/application.rb&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;# Add Bower components to assets pipeline&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;assets&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;paths&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Rails&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;vendor&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;assets&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;components&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id=&quot;add-your-libraries-to-appassetsapplicationjs&quot;&gt;5. Add your libraries to &lt;code&gt;app/assets/application.js&lt;/code&gt;&lt;/h2&gt;

&lt;p&gt;Assets are included by package/jsfile. So, for example, to include angular and angular-resource in my rails app, I added:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;js&quot;&gt;&lt;span class=&quot;c1&quot;&gt;// app/assets/javascripts/application.js&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//= require angular-all-unstable/angular&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//= require angular-all-unstable/angular-resource&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;See &lt;a href=&quot;http://guides.rubyonrails.org/asset_pipeline.html#search-paths&quot;&gt;asset pipeline docs&lt;/a&gt; for more details on how/why this works.&lt;/p&gt;

&lt;h2 id=&quot;ignore-components-in-source-control&quot;&gt;6. Ignore components in source control&lt;/h2&gt;

&lt;p&gt;Finally, we don’t want to commit any of these libraries to our repository so in your &lt;code&gt;.gitignore&lt;/code&gt; file (or equivalent if another vcs) add:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;bash&quot;&gt;&lt;span class=&quot;c&quot;&gt;# Ignore Bower Assets&lt;/span&gt;
/vendor/assets/components
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And that’s it, super simple, but worth remembering next time you’re tempted to paste JS or CSS libraries into your project&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References:&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://guides.rubyonrails.org/asset_pipeline.html#search-paths&quot;&gt;Rails Guide - Asset Pipeline&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://gist.github.com/afeld/5704079&quot;&gt;Aidan Feldman’s guide to rails, bower and heroku&lt;/a&gt; - really useful, came across late in writing this post but definitely worth a look, very similar approach + includes guide for running on Heroku&lt;/li&gt;
&lt;/ul&gt;

</content>
   </entry>
 
   <entry>
     <title>Gmail ads looking a lot more like emails...</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/07/10/google-ads-in-email-list/"/>
     <updated>2013-07-10T10:00:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2013/07/10/google-ads-in-email-list</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;I’m sure I’m not the first one to find this out, but someone pointed out this morning that if you’re using new category-based email, Google has inserted an ad at the top of the “Promotion” tab emails which is now looking more similar to a regular email than before. You can even bookmark/star  the promo/ad if you want.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/img/post_images/misc/google-email-zoom.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;For comparison, this is usually how ads appear:&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/img/post_images/misc/google-email-old.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It’s currently only on the promotions tab and from an advertising perspective, it’s probably pretty smart. After all, I’m there for recent emails relating to deals and promotional material, why not use that knowledge to their advantage?&lt;/p&gt;

&lt;p&gt;That said, with ads looking more and more like my normal emails, for me it’s approaching the grey area where smart advertising becomes trickery. If I’m clicking on an ad because it’s relevant to me, fine. If I click on something I instincitvely believe to be an email but then turns out to be an ad, that’s pretty uncool.&lt;/p&gt;

&lt;p&gt;Is it just me? What does everyone else think about this? Is it even new?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Seems I wasn’t the first to find this out, &lt;a href=&quot;http://www.ghacks.net/2013/06/17/google-testing-ads-that-resemble-emails-in-gmails-inbox/&quot;&gt;Martin Brinkman also writes about it&lt;/a&gt; and there’s a post on the &lt;a href=&quot;http://googlesystem.blogspot.co.at/2013/06/ads-in-gmails-promotions-tab.html&quot;&gt;GoogleSystem blog&lt;/a&gt; about precisely this, with similar viewpoints expressed to those in the comments below and on HackerNews. Overall it seems putting it in “Promotions” isn’t that invasive and people don’t really mind.&lt;/p&gt;
</content>
   </entry>
 
   <entry>
     <title>Notice Anything Different?</title>
		 <link type="text/html" rel="alternate" href="http://pete-hamilton.co.uk/2013/06/23/notice-anything-different/"/>
     <updated>2013-06-23T19:30:00+01:00</updated>
     <id>http://pete-hamilton.co.uk/2013/06/23/notice-anything-different</id>
		 <author>
			 <name>Pete Hamilton</name>
			 <email>peterejhamilton+hi@gmail.com</email>
			 <uri>http://pete-hamilton.co.uk</uri>
		 </author>
     <content type="html">&lt;p&gt;I’ve redone my blog to have a cleaner look. It’s a slightly tweaked version of &lt;a href=&quot;https://twitter.com/fabienpenso&quot;&gt;Fabien Penso&lt;/a&gt;’s design.&lt;/p&gt;

&lt;p&gt;&lt;img class=&quot;center&quot; src=&quot;/img/post_images/misc/site-comparison.png&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve also changed the hosting stack as well. I’m now using:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Plain Jekyll&lt;/a&gt;&lt;/strong&gt; (no longer octopress) for the framework&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://aws.amazon.com/s3/&quot;&gt;Amazon S3&lt;/a&gt;&lt;/strong&gt; for hosting. Deploying with &lt;a href=&quot;https://github.com/laurilehmijoki/jekyll-s3&quot;&gt;jekyll-s3&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://aws.amazon.com/route53/&quot;&gt;Amazon Route 53&lt;/a&gt;&lt;/strong&gt; for DNS (&lt;a href=&quot;http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html&quot;&gt;guide&lt;/a&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://aws.amazon.com/cloudfront/&quot;&gt;Amazon Cloudfront&lt;/a&gt;&lt;/strong&gt; for a CDN&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://gaug.es/&quot;&gt;Gauges&lt;/a&gt;&lt;/strong&gt; for analytics, something I’ve always wanted to try.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wasn’t aiming for any performance improvements or anything but I did notice that page load times went from ~1500ms to ~800ms so it’s been essentially cut in half.&lt;/p&gt;

&lt;p&gt;However I did this for fun. I’m not exactly being slammed traffic-wise :)&lt;/p&gt;
</content>
   </entry>
 
</feed>
