blog.eliotsykes.com

Icon

Using Prototype to load Facebook API on demand (or any other script)

I was trying to figure out how to get PrototypeJS to load the Facebook JavaScript API on demand.

For Missed Connections I’m writing a modal box that can optionally display a Facebook connect button, but I didn’t want to load the Facebook API unless the Fb connect button is shown.

In the end I wrote FacebookApiLoader to do this, you can find the source and details here:

http://stackoverflow.com/questions/2117691/using-prototype-to-load-a-javascript-file-from-another-domain/2123219

Many thanks to Thomas’s answer which pointed me in the right direction.

Freecycle alternatives for UK

Early last Summer I used SnaffleUp to freecycle some dvd cases and jiffy bags, but then I couldn’t remember its name when I wanted to get rid of an old artificial Xmas tree last month.

Next I tried Gumtree’s London free section but that didn’t work out so well (I’m guessing its normally better), so in the end the tree went to the Salvation Army.

Anyway, I guess in December I had a problem with my brain and couldn’t figure out the simple task of searching through my old e-mails to remind me of SnaffleUp’s name. So what I’m doing here as a memory aid and to help others is listing the alternatives to Freecycle for the UK that I’ve found, comment below if you’ve found any others or have some feedback on the services:

Tried (rating)

  • SnaffleUp (5 out of 5)
  • Gumtree (3 out of 5)
  • Freecycle Yahoo Groups (2 out of 5 – low rating because if memory serves you’re forced to join a mailing list through Yahoo Groups – I’ve found a dedicated web site like SnaffleUp is easier for freecycling)

Not tried

  • Freegle – set up by massive breakaway group of UK Freecycle users who weren’t impressed with how Freecyle was being run. Nice looking web site but still uses Yahoo Groups and mailing lists by the looks of things.
  • Recycle

Sprixi – New way to find free images for your blog

sprixi

Here’s an alternative and easier way to Flickr Advanced Search for finding free images for your blog:

http://www.sprixi.com/

Thanks to The Next Web for the article that made me aware of Sprixi

Alcohol Free Christmas Pudding Recipes

christmas-pudding-alcohol-free

Its a few days before Christmas and I feel like making an alcohol free Christmas pudding, here are links to 3 recipes, none of which I’ve tried:

Hopefully collecting these recipes in one place will help someone else out.  If you find any other recipes add a comment and I’ll add the links above.

I’m planning on using the first recipe as the quantities seem to be small enough for making a single good-sized pudding – the second and third recipes are for making a few puddings.

Q&A on Kickstarter blog

Kickstarter_logo

Funny thing happened this week.  Thanks to my tight-fisted goal of pledging a dollar a day to a different Kickstarter project, I ended up having a Q&A with Kickstarter’s wonderful Cassie Marketos (check out Cassie’s mail-order snackfood project) and the results of which you can read on the Kickstarter blog: Why I Pledge: Eliot Sykes. There’s a few ideas in there that I hope will help get even more Kickstarter projects funded.

3 ways to use SendSocial, 7 things to send, 3 things not to

sendsocial-logo

SendSocial is a new service (available in just the UK initially, other countries to follow) that lets you post anything to anyone when all you have is their twitter username or their e-mail address.  You don’t need to know their home or work address.

This is one of those ideas that made me think wow, that’s a cool idea.  I’m a tad amazed this hasn’t been done yet (if it has been, let me know in the comments, sounds like the sort of thing that someone would have tried back in the original dotcom bubble).

The idea has legs and the track record of one of the guys behind it, Ben Way, makes you think it has got a great chance of doing well.  I hope so, I love to hear UK startups making it worldwide.

A few ways that come to mind on what to use SendSocial for apart from sending gifts to virtual friends:

1. Say thanks to a blogger or twittering friend
Is there someone who’s given you help through their tweets or blog? You could send them a note or even a gift – much more personal than an e-mail. I was thinking of sending some food to one or two people I follow virtually who’s advice has helped me out but that’s probably a bit of a bad idea, would you feel 100% safe eating something that a near stranger sent you? A gift voucher or a handwritten note is probably a safer bet.

2. Let influencers know about your new product/book
Launching a new product that lends itself to physical samples or a book? Send samples in the post to blogger and twitter influencers related to your industry.

3. Get the attention of a journalist/blogger/celebrity
Send something in the post to get the attention of a blogger who gets way too much e-mail from strangers for you to stand a chance of being heard over the crowd.

7 things to send:

  1. A handwritten note
  2. A Xmas/Birthday/Holiday/Thank you card
  3. Home made treats (if you know the recipient)
  4. Chocolates, but not (I think people won’t be keen to eat food sent by strangers).  Send a small gift card instead for somewhere they can buy chocolates of their choice (I’m having a hard time coming up with ideas for this – Thorntons? WHSmith do chocolate now too right? Any other ideas?)
  5. Cup of Coffee – send a Costa/Nero/Starbucks/Pret/etc. gift card is what I mean
  6. A Book or DVD you think they’d like
  7. Gift card for Amazon or any other shop you think they’d like

3 things not to send:

  • Ticking alarm clock
  • Lock of your hair
  • Anything written using blood

What do you recommend sending, or not?

Great idea for crafting your own shirts – Blank-Label.com

blank-label-shirt

I can’t remember how I found them, but when I did I signed up for Blank Label’s launch e-mail a few weeks back just ‘cos I love the idea.

In a world of design your own t-shirt startups, Blank Label is a breath of fresh air that lets you design your own (proper collared) shirts (like the one in the photo above I guess, taken from their home page). Are there other sites that give you this option? I don’t know, anyway I liked the tone of Danny Wong’s launch e-mail:

For being our beloved friend when we had a sh*t website and signed up early for the launch, here’s your special promocode for 20% off your first order.

(I’m guessing the Blank Label guys won’t mind me sharing the promo code here: “20peroff”). Here’s their home page

Heroku vs EngineYard Cloud vs Joyent

heroku vs   logo-engineyard vs   joyent

Scroll to end to see detailed updates, in brief:
Update 1 – Heroku respond to EngineYard’s e-mail
Update 2 – EngineYard Co-Founder Tom Mornini tweeted about the tone of sales rep’s e-mail

I’m getting bored of Joyent’s shared accelerator manual mongrel restarts so I’m considering switching hosts, plus one of their employees totally wasted my time after they contacted me on twitter out of the blue – I know most Joyent customers have a good relationship with them, unluckily and I expect uncharacteristically I’ve only had an average experience with them.

Anyway, so the candidates were Heroku and EngineYard Cloud.  Heroku is very unlikely due to their $100 per month full on SSL costs.  After I posted a comment about this on RubyInside, an EngineYard rep sent me the following email:

Hi Eliot,

You should also know Engine Yard Cloud comes up to 40% cheaper than Heroku. We deliver a better solution with a much easier INCLUDED SSL service.

Not to mention with Heroku you are relying on their multi-tenant architecture (their app goes down so does your app) – not the case with Engine Yard. In addition to having a more secure environment, and save cost, our dashboard is built on a battle tested Rails Stack for the last 3 years.

Also here’s some information on further details:

Our cloud dashboard allows you to easily create and manage an infrastructure for deploying rails applications.

You can easily deploy rails applications and all their dependencies including any gems from any git repository via the dashboard UI or from the command line with a special git commit message.

Heroku doesn’t offer support or monitoring. – Our cloud dashboard allows you to easily create and manage an infrastructure for deploying rails applications. We ping your site every two minutes and manage alerts that are sent directly to you in an email.

We have customers running very redundant environments via the app server load balancing and master-slave DB configurations we provide at the click of a button. In addition, our design has the safety of not making customer environments reliant on our own application. If there is a problem in our application it only effects the ability to deploy, provision new resources, etc. It doesn’t effect the operation of a customers running environment at all and we feel adds more safety than the multi-tenant environment in Heroku.

Also, we did a pricing analysis against Heroku and we discovered that once you have gone beyond the low priced/free entry level servers with Heroku, you might be paying a lot more.

Check this out:

Let’s take a production app running on two small instances on Engine Yard Cloud and a third instance running a dedicated database. And let’s say you have 10GB of data with daily snapshots = 300GB of data (very, very conservative – assumes that all the data changes every day).

On Engine Yard that configuration will cost (Cloud Plan):
2 x small instances = $259.20
1 x database instance = $129.20
300 GB of EBS space = $30.00
Bandwidth + i/o ~ $20.00
*******************************
Total = $438.40
(Each small cloud instance runs 6 mongrels, so this runs 12 mongrels in a redundant configuration.)
An equivalent environment on Heroku would be:
12 Dynos = $396
Ronin Database = $200
Backups = $20
************************
Total = $616.00

In this case, Engine Yard works out to be about 30% cheaper than Heroku.

If you are interested, I would be happy to discuss this in further detail or show you a quick technical demo of our Engine Yard Cloud product. Please let me know what are good dates and times for you to talk next week.

Thanks for your time, I appreciate it.

Best Regards,
Manpreet

It was considerate of EngineYard’s rep Manpreet to contact me, but to be honest he’s scared me off with those hundreds of dollars quotes like that’s nothing for a small guy startup like me to pay for hosting.

Anyway, I post this here in the hope it is of use to others weighing up the differences between Heroku and EngineYard.

I’ve e-mailed Heroku about the following things, I’ll update the blog if I get a response Heroku have responded see Update 1 below.

  • Heroku’s multi-tenant vs EngineYard’s single-tenant architecture
  • EngineYard’s claim Heroku doesn’t offer support or monitoring
  • Estimates for sites with 10,000 / 50,000 / 100,000 visitors per month

Update 1
Oren Teich of Heroku has kindly taken the time to send this detailed response – many thanks Oren

Hi Eliot,

Thanks for getting in touch. To respond to each of your questions directly:

* Heroku’s multi-tenant vs Other’s single-tenant architecture

In any compute environment, if a server fails that will impact your application. That isn’t different if you’re on Heroku or any other provider. The question is, how do you handle the failure. The very multi-tenancy that Heroku provides gives us a huge advantage in handling this. Every system is fully redundant for EVERY user on Heroku, from the $0/month on up. This means that there is no single point of failure (SPOF).

When you use a service that makes you manage your own VMs/AMI/EC2 images, the SPOF problem is _yours_ to manage and maintain. When you start small with a single image, if that image goes down your app is down. The Heroku stack is made up of 6+ discreet layers to provide users with the performance and flexibility they require. If you wanted to duplicate this setup elsewhere, you would need at least 12 different images.

* The claim Heroku doesn’t offer support or monitoring

This is false. http://support.heroku.com is available, and as you can see from tweets on twitter, people love our support. It is true that we don’t offer 24×7 support right now, though that is coming soon. All apps are fully monitored. Heroku’s entire philosophy is to take the management pain out of the hands of the customer. We don’t make you manage your own images. We don’t make you manage software payloads.

The way we handle monitoring specifically is we have extensive internal monitoring, tracking over 100 metrics. 99% of the time, we are able to resolve any issues without the customer ever experiencing any issues. On the rare situations that an issue is visible to the customer, we post an update to http://status.heroku.com and reach out to effected users, working with them 1:1 to ensure their app is fully restored.

* Estimates for sites with 10,000 / 50,000 / 100,000 visitors per month

This is always tricky, since every app is different. Here’s the short version – 10,000 per month should easily be handled by the free dyno. 50,000 is $36/month. 100,000 is up to $100/month, depending on your app performance. For reference, we have sites serving >200,000,000 (yes million) visitors per month, and they spend in the range of $1500.

From the deployment in <5 minutes to a COMPLETELY managed operational stack, we believe, and our customers tell us all the time, that Heroku saves them hours, days and even weeks. Often, by using Heroku our customers are able to forgo additional hires. As a user of Heroku said (http://news.ycombinator.com/item?id=883691), “It’s only expensive if your time is worthless”. That said, we often wind up being an incredibly reasonable place to host your application.

The details: Let’s make a few assumptions. If you’re app responds to a request in 200ms, each dyno can serve 5 requests per second. A free dyno could theoretical serve of 432,000 requests per day. Even with peaky traffic and multiple reuqests per visit, that’s still 20,000 visitors per day, for FREE. To get concurrency with 2 or more dynos, you’re now serving twice the traffic. It’s literally 1 second to change your concurrency, and we bill based on the hour so you can do it anytime, and see the impact for yourself.

Ultimately of course, this is just a vendor selling their product. The best thing to do is try it out for yourself – get an app up and runing on Heroku, and let us know how it’s working for you! We think you’ll love it, and we’d love to hear your feedback, good bad or indifferent!

Thanks for giving us the time to answer your questions,
Oren Teich

So who would you opt for?

Both hosts have very happy customers who swear they would never go anywhere else so I’m going to assume their service levels are high and comparable to each other (especially for my meagre needs).

So what separates them in my mind for my small solo startup use case is initial cost and personality.

And so my choice between the two would be Heroku, because 1) how honestly presented their communication was; 2) they didn’t make any false claims against their competition; and 3) you can try out their offering free. See Update 2 below, EngineYard’s CTO agreed the e-mail was in a poor tone and has taken steps to rectify it.

For me this doesn’t end here, there is one thing that is stopping me from switching to Heroku – I want a full SSL cert for Missed Connections and the cost is $100 per month, which I can’t stretch to, so that leaves me back at square one :-( .  If I come up with a new option I’ll report it here. (Here’s why Heroku’s full SSL fees are at this price)

Update 2
EngineYard Co-Founder and CTO Tom Mornini kindly tweeted about the original EngineYard e-mail. Due to EngineYard’s enthusiastic customers I get the feeling the dodgy tone of that e-mail was uncharacteristic of EngineYard and Tom’s tweet confirms that:

@eliotsykes I apologize for tone of initial email. I’ve personally communicated displeasure with tone to our VP Sales, who agreed. From @tmornini

Virtualbox How To: Accessing Guest Apache from Host

For Virtualbox users, here’s a useful article on how to access Apache running on your guest OS from within your host OS.

In brief, assign port 8888 on host OS (Windows XP for me) to forward to Apache’s port 80 in the guest OS (Ubuntu for me) with these commands:

cd C:\Program Files\Sun\xVM VirtualBox
VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888
VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80
VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP

Shutdown Virtualbox completely, not just the guest OS, but the Virtualbox application too. Start Virtualbox back up, start the guest OS, open a browser in your host OS, and go to the URL http://localhost:8888/ to see your Apache home page.

Fixing “A copy of ApplicationHelper has been removed from the module tree but is still active”

I found a few Ruby on Rails questions posted that ask how to fix “A copy of ApplicationHelper has been removed from the module tree but is still active” errors, unfortunately none seemed to have solutions.

So unluckily I got this error yesterday (in development environment only) with Rails 2.1.x.

I narrowed it down to a method I’d added to ApplicationHelper which used a class method on an HtmlUtil module I’d written.

The new method in ApplicationHelper is as follows:

module ApplicationHelper
  ...
  def title
    HtmlUtil.escape_html page_title
  end
  ...
end

The problem was only the first request after a server restart would work.  Subsequent requests would give the “A copy of ApplicationHelper has been removed from the module tree but is still active” error message.

To fix it I ‘require’d the HtmlUtil at the top of ApplicationHelper:

require 'html_util'
module ApplicationHelper
  ...
end

So, if you’re getting this error, you may be using another module in your ApplicationHelper. Try to fix it by requiring the module at the top of the helper.

Who’s Blog?



Hello, I’m Eliot Sykes and this is my blog. Thank you for visiting. I'm the Founder of Missed Connections and responsible for How Not To Run A Startup


Read about my current projects, contact me or find me on github