Ted Piotrowski

Code to live. Live to spend time outdoors.

Read this first

Enabling TLS for SAC Alerts notifications

FYI: Transport Layer Security (TLS) keeps hackers from seeing your internet traffic including the contents of the emails you send, your account passwords and the websites you read.

I aimed to keep costs low when building Steep and Cheap alerts because revenue was $0. I configured my own Postfix mail server instead of paying for services like Twilio, Mailgun and Sendgrid. My $20/month Linode server can easily host the website and handle several thousand outgoing emails per day. One downside of self hosting is having to tweak the mail server occasionally as best practices change. This happened recently when I noticed that Gmail was putting a scary broken red lock on SAC Alerts emails because the transmission was unencrypted.

email-tls.png

 The fix

Unfortunately, I didn’t tackle this issue for a few months because I’m not an email expert. There was a risk of unintentionally breaking the alert...

Continue reading →


Interviews: Take home projects

screenshot.png

While interviewing for a new role I encountered the dreaded take home project. Just to clarify, I found the experience very enjoyable, however, I must acknowledge that some engineers have called it “working for free”. The requirement for this take home project was building a multiplayer network game. Players connecting to the server are automatically matched with another anonymous player and proceed to duel it out in a game of Connect 4.

Back when I used to conduct interviews at Atlassian, I had misgivings about the ability of a 90 minute pair coding session to expose the traits of a mature developer. My current belief is that good developers are ones that demonstrate an ability to manage complexity. Meanwhile, most coding interviews still test a developers ability to codify an algorithm within a certain time limit. My ideal interview at Atlassian would be to provide the candidate...

Continue reading →


Learning React Native by building a Stacker clone

stacker.png

I made React Native game over the weekend. It’s a simple clone of Stacker and you can play it by installing Expo Client on your phone and following this link.

If you don’t want to install the app, you can play the text based browser version here (warning: it’s not pretty). Here is the source.

The goal of the game is to stack boxes on top of each other. Each time you tap the screen the currently moving box stops and another box above it starts moving. Wait until the moving box is on top of the stack and tap the screen. If the boxes don’t align over the top of each other you lose. Get to the top of the screen and you win. Here is a video:

 How I built it

I found an amazing tutorial at http://www.reactnativeexpress.com/. It takes about a day to complete and covers sufficient material to create advanced phone applications. I especially liked the intro section where you actually get a...

Continue reading →


3D printing revolution

Felix_3D_Printer_-_Printing_Head.JPG

I just completed the two week 3D printing revolution course. Week one was a good overview of what 3D printing is, while week two highlighted applications of 3D printing. I took a 3D printing class at Duluth Maker Space two years ago and completed a small project. My opinion at the time was that it is a crude tool suited for hobbyists and incapable of manufacturing retail products. I must admit that the course altered my opinion significantly and now I believe that 3D printing is indeed revolutionary.

The first thing that swayed my opinion is that there are many different methods of printing, some of which can produce well polished products. Previously I was only aware of Fused Deposition Modeling (FDM) which is analogous to squeezing plastic toothpaste out of a small tube in progressive layers to create a 3D object. This leaves a crude layered finish on a product. However...

Continue reading →


Bachelorette motivations

Screen Shot 2018-06-08 at 11.27.51 AM.png

The Bachelorette season is upon us again. I must say I enjoy the show. It advertises itself as a path to finding lasting love but its success record is less than impressive. And thus it satisfies my formula for great television:

Expectation fails to meet reality == great television

Some of the antics on the show also make me wonder how much of the show is scripted and which of the cast are looking for media exposure versus true love. Lets look at some data.

I wrote a script to aggregate data from the contestants’ Instagram accounts. Five of the 30 contestants either deleted or never had an Instagram account leaving us with 25. Of these I looked at total followers and number of Likes gained on their most popular post (to indicate newly gained followers).

It looks like Grocery Joe and mule wielding Blake Horstmann are crowd favorites, each gaining 10,000 additional likes on their...

Continue reading →


Ghosts in the machine

”One of the biggest differences between hobbyists and professional programmers is the difference that grows out of moving from superstition to understanding.”
-Stephen McConnell

In my early days of programming I often fell into the trap of refreshing a broken application multiple times to make sure it was “really broken”. In hindsight this seems silly. A computer does not behave randomly, however, deterministic behavior can lead to some interesting quirks.

function getGreeting() {
  const hour = new Date().getHours();
  const greetings = [
    [22, 'Working late?'],
    [18, 'Good evening'],
    [12, 'Good afternoon'],
    [6, 'Good morning'],
    [4, 'Whoa, early bird!']
  ];
  return greetings.find((greeting) => { hour >= greeting[0] })[1];
}

Do you see the problem? (Hint: This will work flawlessly during office hours but result in a late night support call) Along the same lines...

Continue reading →


Use a professional IDE

At some point in their career programmers stumble upon VIM and find the boost in productivity to be so great that they treat the find like an epiphany handed down from above. I personally love VIM and think everyone should have a go at learning to use it effectively. However, do not stop evaluating other editors that may be better suited for you specific language or project. If you’re getting paid to code, don’t be opposed to the idea of paying for a professional IDE.

Recently I’ve been frustrated by the following argument: “I only use VIM because it’s super fast and lightweight. It feels closest to the bare metal of the machine.” After this statement I watched the developer navigate to find the definition of a class used in another file as follows

  1. gg - two keystrokes to navigate to top of file
  2. look at import statements
  3. :e . - four key strokes to open file navigator
  4. /Libr - five...

Continue reading →


Broken video attachments in Gmail

My sister often emails video attachments of my niece and nephew. Gmail provides a really sleek mechanism for viewing the attached videos without leaving the browser by playing them in an embedded YouTube player. However, at some point the YouTube player started presenting me with the following message: “An error occurred. Please try again later.” Let’s dig in.

blog1.jpg

 The cause

Disabling third-party cookies in my browsers was the cause of this issue. Some browsers like Firefox have this disabled by default. To see if you’re video playback is broken for the same reason visit this page. If you see “Third party cookies appear to be disabled”, then read on for the solution.

 Background: third-party cookies

When you log in to a website like Gmail you provide your email/password and in the background Gmail’s servers send you back a cookie containing a session ID (for example...

Continue reading →


Designing Slouch Cam

Screen Shot 2017-06-19 at 8.01.02 AM.png

Recently I’ve had some free time to take up another personal project. The idea is that your computer’s web cam watches your head position and alerts you if it gets too close to the screen. My mind has never been able to kick the habit that the closer I bring my face to the screen the better I will understand whatever is written on it. And so we come to my golden rule of side projects:

Build something that benefits your life. This will provide you intrinsic motivation (happiness) while you wait for the extrinsic motivators (money, fame) to kick in.

I’ve seen a lot of people violate this rule by brainstorming business ideas that can make a lot of money but don’t affect the creator personally. My view is these founders will run out of steam long before their project earns them a full time paycheck.

But I digress….

 The design

I wanted to follow two design principles:

 Limit wordy

...

Continue reading →


Aspiring Flats and Rock of the Ages bivvy

FullSizeRender 31.jpegMeadow at Aspiring Flats

Most people who spend time in Wanaka will drive down the west Matukituki valley and hike to Rob Roy glacier. The less popular East Matukituki valley offers a seldom travelled alternative. In fact, I found the valley devoid of human life the evening I hiked in. Plenty of cows, though. The most accessible destinations of interest are the Aspiring Flats and Rock of the Ages bivvy which are located on a tributary of the East Matuktuki.

FullSizeRender 35.jpegFollow this road, second valley on left in the distance is your destination

The walk begins by crossing an impressive bridge across the West Matutuki. Follow the route markers along the true left bank until you come to private land. You’ll need to remove your shoes for three water crossing before heading north along a road for some time. You will go through a gate. Next follow a long, long fence. There is a worn road running...

Continue reading →