In reply to your unsolicited recruitment email

<redacted>,

I ignore because I get too many emails to reply to all of them and I don’t completely trust recruiters to honor my requests to be left alone.

In my experience recruiters are very rude:

  • They don’t take the time to look into my background.
  • They contact me regarding positions that are unrelated to my skill set.
  • They contact me via a private work email address. Seriously?
  • They call me out of the blue during business hours.
  • They push their own agenda and don’t listen to me.
  • They don’t seek to form a relationship, something which would obviously be mutually beneficial.
  • They solicit referrals, which is simply rude.
    • Why would I pursue a position that you “hand picked” for me when you will gladly take anyone else I can steer your way?
    • Why would I risk my reputation for a referral fee of an iPad or a few thousand dollars? You should know that the candidate you are targeting is in an income bracket that is not excited by such things.

I take my career very seriously, if I don’t get the impression that you do as well then I want nothing to do with you.

I don’t mean to criticize you personally <redacted>. I don’t know you, it’s not fair of me to assume that you are just like all the other recruiters I have encountered. I don’t know how to recruit, I don’t know what tactics work, but I do know what turns me off as a candidate. I am sharing my experiences with you because you seem to be looking for some insight into my actions. I hope that you find this helpful in some way.

Have a nice day,
Sam

CloudFront CORS with Custom Origin

Modern browsers respect Cross Origin Resource Sharing which means they won’t load web fonts (.woff, .ttf, etc.) from a CloudFront distribution.

If you are using a custom origin (AKA your website) for CloudFront you need to do the following:

1. Send the header Access-Control-Allow-Origin: * when serving up web fonts on your server.

Example for Apache (in .htaccess):

# Set CORS headers so CloudFront will forward them
 <FilesMatch ".(eot|ttf|otf|woff|svg)">
 Header set Access-Control-Allow-Origin "*"
 </FilesMatch>

2. Edit your CloudFront distribution Behavior to Forward Headers and add Origin to the whitelist. I know this doesn’t make a ton of sense but that’s how AWS set it up (source).

CloudFront whitelist Origin header

 

3. Invalidate your cache from the AWS console or just wait until CloudFront refreshes its cache.

Use DateTime instead of Date for ActiveRecord ranges

I was working with a query that selected all “Orders” created this month, it looked like this:

@today = Time.zone.now.to_date
@start_date = @today.beginning_of_month
@end_date = @today.end_of_month
@orders = Order.where(created_at: @start_date..@end_date)

and the resulting SQL query looked like this:

SELECT `orders`.* FROM `orders` WHERE (`orders`.`created_at` BETWEEN '2014-08-01' AND '2014-08-31')

…but since Rails automatically converts Date objects from localtime to UTC the dates in that query should have been offset by my timezone (in this case PDT -7 hours).

The fix was simple, use DateTime objects instead of Date objects and Rails automatically calculated the offset based on my Timezone (config.time_zone):

@today = Time.zone.now.to_datetime
# ...

and the fixed query:

SELECT `orders`.* FROM `orders` WHERE (`orders`.`created_at` BETWEEN '2014-08-01 07:00:00' AND '2014-09-01 06:59:59')