Skip to content

Instantly share code, notes, and snippets.

[Published March 16th 2006, https://web.archive.org/web/20061127141948/http://www.bitgain.com:80/blog/show/5]

While driving from my home town (Hoorn, The Netherlands) to Amsterdam, I saw a lot of cars with the small TomTom device mounted (with Velcro, mind you) on top of the dashboard. Although it looks a bit amateurish, many people really seem to like the driving directions it gives.

I wonder whether companies like TomTom, or its rival Garmin, can uphold the outrageous pricing level of their products. The avarage TomTom device costs a whopping EUR 600 and for what? The components inside the device cost no more than $80 I guess. And of course TomTom must license the map data from Navteq or TeleAtlas, and they have to finance expensive marketing campaigns (also in the US since a few months).

I'm always a sucker for scenarios in which a whole vertical market gets beaten by a killer app. I think the GPS device market runs such a risk. Bear with me for a moment:

  • The TomTom software adds no spectacular value
@evaneykelen
evaneykelen / group-policy.json
Last active June 13, 2020 05:06
aws policy
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::*"
},
@evaneykelen
evaneykelen / s3-policy.json
Last active June 13, 2020 05:06
aws policy
{
"Version": "2012-10-17",
"Id": "Policy154...",
"Statement": [
{
"Sid": "Stmt1542...",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::744...556:user/s3-user"
},
{
"Version": "2012-10-17",
"Id": "Policy154...",
"Statement": [
{
"Sid": "Stmt15420...",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::744...556:user/s3-user"
},
@evaneykelen
evaneykelen / sqs.rb
Last active June 13, 2020 05:05
sqs
require 'open3'
class Sqs
def self.process_messages
sqs = Aws::SQS::Client.new(region: ENV.fetch("AWS_REGION"),
access_key_id: ENV.fetch("AWS_ACCESS_KEY_ID"),
secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY"))
queue_url = sqs.get_queue_url(queue_name: ENV.fetch("AWS_SQS_QUEUE_NAME")).queue_url
poller = Aws::SQS::QueuePoller.new(queue_url, { client: sqs })
@evaneykelen
evaneykelen / keybase.md
Last active June 13, 2020 05:04
keybase

Keybase proof

I hereby claim:

  • I am evaneykelen on github.
  • I am hackteck (https://keybase.io/hackteck) on keybase.
  • I have a public key whose fingerprint is BBC4 19FF C4B7 281D C2F8 5331 CEBA 9715 B32B C1C5

To claim this, I am signing this object:

require 'benchmark'
array = File.readlines('dutch.bin') # 10k lines
Benchmark.bmbm do |x|
x.report {
x.report("tr") { array.each { |line| line.tr('e', 'z') } }
}
end
@evaneykelen
evaneykelen / size_vs_count.rb
Last active August 25, 2019 07:26
`size` vs `count` benchmark
require 'benchmark'
array = File.readlines('dutch.bin') # 10k lines
hash = Hash[*array] # 5k keys => 5k values
Benchmark.bmbm do |x|
x.report {
x.report("Array count") { 10_000.times { array.count } }
x.report("Array size") { 10_000.times { array.size } }
x.report("Hash count") { 10_000.times { hash.count } }
@evaneykelen
evaneykelen / array_vs_set.rb
Created August 25, 2019 07:19
Array vs Set benchmark
require 'benchmark'
require 'set'
array = File.readlines('dutch.bin') # 10k lines
hash = Hash[*array] # 5k keys => 5k values
set = array.to_set # 10k entries
line = array[-1] # Last line
Benchmark.bmbm do |x|
x.report("Array.include?") { 10_000.times { array.include?(line)} }
@evaneykelen
evaneykelen / crr.md
Last active June 19, 2019 07:04
Colorize `rails routes` output and insert line breaks between controllers