How to Serve Web Sockets with Http4s

Using Web Sockets, Http4s and FS2 are a great way to send streaming data to a client…

July 9, 2022 · 2 min · Stephen Nancekivell

Simplifying Go Concurrency with Futures

Concurrency in golang can get tricky, now that generics have landed a Future library can help.

May 17, 2022 · 5 min · Stephen Nancekivell

Building Docker Dash - Technical Decisions

Docker Dash is my new SaaS side project, it helps teams manage the security of their docker containers. This post is about some of the technical decisions I’ve made while building it.

November 18, 2021 · 4 min · Stephen Nancekivell

Docker Repository Cleaning

How to clean your Docker Repository

April 12, 2021 · 2 min · Stephen Nancekivell

How to Improve your Scala Compilation Times

How to Improve your Scala Compilation Times

April 12, 2021 · 5 min · Stephen Nancekivell

Improve SQL Join Queries that use Temporary Tables & File Sorts

Eliminate file sort for fast queries

March 27, 2021 · 3 min · Stephen Nancekivell

How to use a Raspberry Pi as a home server instead of a VPS

How to use a Raspberry Pi as a home server instead of a VPS

February 7, 2021 · 1 min · Stephen Nancekivell

Growing Web Traffic at Real Email

How I grew the web traffic to Real Email

January 25, 2021 · 3 min · Stephen Nancekivell

Building a work queue with Scala & FS2

I’ve recently improved the csv parsing in my side project Real Email and built a work queue using FS2. In this post I will explain how to build a work queue with cancellation. The context for my work queue is that im validating csv files from a typical web app. This happens from the browser which then uses http polling to query for progress. The more interesting feature are that I wanted a way to cancel the processing and a way to limit the number of concurrent validations happening at once in case of a sudden spike in usage....

September 12, 2020 · 3 min · Stephen Nancekivell

Adding CSV to Real Email Validations and feature validation

Im pleased to announce that on Real Email you can now validate a csv file using some interactive features. Real Email is a developer focused email validation service, allowing you to check if an email address is real, before sending anything and possibly hurting your email reputation through bouned emails. Its always been possible to possible to validate a csv file with a clever shell script but its not very user friendly, I didnt think it was a very important use case for my market....

July 31, 2020 · 2 min · Stephen Nancekivell

Model driven form builder component in Angular

Model driven components are a great way to quickly build out an app with consitent styling. A form builder component can make it easier to build apps.

June 30, 2020 · 4 min · Stephen Nancekivell

Avoiding Scala Thread Exhaustion in Scalacache

In this post im going to talk about thread exhaustion of the scala global execution context and a curious case where it came up in a old version of scalacache. Its classic scala advice that you shouldnt use the default execution context, in this post we will look into detail why. We will look into how it is then avoided in scalacache while maximising code reuse. Background Use of Await.ready starts a new thread on the default execution context, so if that happens enough you can run out of threads....

March 15, 2018 · 6 min · Stephen Nancekivell

Scala Circe, Argonaut Shapeless, Play Json Compile Times

Slow comile times in scala are a common complaint. This is usually because of advanced usage of implicit resolution and macros. The JSON libraries ArgonautShapeless for Argonaut, Circe and play-json make heavy use of that. I love the convience this approach provides, and I think its better than manually building codecs. Manually codecs can be error prone because you have to be careful about the position of arguments which may not even be defined in the same file....

July 6, 2017 · 2 min · Stephen Nancekivell

Tricks with Futures

This presentation shows some tricks for dealing with Scala Future’s.

December 10, 2016 · 2 min · Stephen Nancekivell

How to examine and optimise locking in MySQL

Consider the following queries, each will lock the database in different ways. In this post Im going to show you how you see where each one is locking, and how to optimise it. update TabFoo set bla = ‘bla’ where id = 1; update TabFoo set bla = ‘bla’ where foo = ‘bla'; To see the locks in MySQL innodb, start a transaction run the query, then inspect the innodb status....

March 7, 2015 · 3 min · Stephen Nancekivell

How to write more maintainable code with the angular.js controller as syntax.

The Angular.js team have added a new way to access variables within your controller. When I first saw this I glossed over it and missed the point thinking it was just shortcut syntax, more ways of doing the same thing, but its not. In this post I’ll explain why the controller as syntax is good and you should be using it. The angular controller as syntax looks like this.. ng-controller=“MyController as ctrl1” with access like this....

January 6, 2015 · 3 min · Stephen Nancekivell

Scala Testing Techniques

This post is about some of the different ways we can test our scala code. I think this is a bit of an overlooked subject, you don’t see too many scala tutorials that show you how you should test and its often quite different. At the surface this seems pretty basic, but like most code there are lots of ways to do it. No mocking You could test something by running it, and checking that it does what it should....

December 13, 2014 · 5 min · Stephen Nancekivell

A Comparison of Angular Routers

When programming using angular.js the routers control the view, they are the link between the page url and what you see, what templates and controllers are shown on the page. In the Angular (1.x) ecosystem there are 3 main routers.* The standard router. angular-route* Angular-ui’s router ui-router* Angular-route-segment angular-route-segment SegmentsOne of the notable features is the ability to change segments of the page. Being able to have nested views, this is useful if you have a dynamic header with dynamic main content section....

December 8, 2014 · 3 min · Stephen Nancekivell

Integrating Play Micro Services With Shared Sessions Through Javascript

This post is about how to integrate sessions in Play Framework servers through javascript. Where you have two different servers (micro services) and you want to share the session between them. Because the session in play is just stored in a secured cookie the servers dont need to communicate, they just need the same encryption key application.secret usually in application.conf. This is used to sign the session cookie so if its changed the server rejects it....

June 11, 2014 · 1 min · Stephen Nancekivell

URL Shortener

This post is going to be a discussion about url shorteners, what the problems are, and how they could be useful, some potential business ideas. IT people will be familiar with these techniques, but these things are not obvious to everyone. The basic idea is to take big url and make it shorter so it can more easily be shared. In some places its nicer to have short urls like http://stephenn....

May 4, 2014 · 3 min · Stephen Nancekivell

Review: Making your own Angular.js

Tero Parviainen has written this amazing article. Making your own Angular.js http://teropa.info/blog/2013/11/03/make-your-own-angular-part-1-scopes-and-digest.html Its amazing how much you can make with frameworks like angular.js without understanding it. But learning how it works is going to help you use it better and make better apps. Im finding with my scala server side programming that I dont need a big framework. With techniques like passing functions Im able to easily remove boiler plate....

April 24, 2014 · 1 min · Stephen Nancekivell

My first shot at testing a market

One day I want to start a online business, to sell some software as a service or something. Im not sure what yet, but when I do I'll need to do some marketing. I've never really done that. You cant have a business without customers, you cant have customers without marketing. So I decided to try testing a simple marketing strategy, Adwords. I put up a simple website, a fake online store that sold nuts, an existing market, something I knew people already wanted....

April 4, 2014 · 2 min · Stephen Nancekivell

Hosting Files In S3 Securely

This post is about hosting files securely on amazon S3 and making those available through a web app. It can be a bit tricky to configure S3 through its various caches. Setup the bucket with webapp user that can upload / download make links. First off we need to create a user in amazon IAM for our webapp to login as. Do this through the console and take note of its ARN, use the keys to login....

March 19, 2014 · 1 min · Stephen Nancekivell

Javascript apps and rendering big lists

While writing apps with angular.js (which I love) I've come across performance issues when rendering big lists. Like in searchbrew.com. For example if I do this with 2500 docs. It takes a while to render and slows the page down. <tr ng-repeat="doc in allDocs">     <td><a ng-href="{{ "{{" }}doc.url}}">{{ "{{" }}doc.title}}</a></td>     <td>{{ "{{" }}doc.description}}</td> </tr>We can see and measure this performance using chromes flame chart in the javascript cpu profiler....

March 14, 2014 · 1 min · Stephen Nancekivell

searchbrew.com

I made this website the other day. searchbrew.com This article about how I made it. Its a search for hombrew packages. Brew by itself doesnt have a very good search, because they dont want to collect description metadata about packages. Brew does have a link to the homepage of each package. I tried getting descriptions and indexing the homepage for search, but it didnt work very well. Then I came across this project telemachus/homebrew-desc which includes project descriptions....

December 31, 2013 · 2 min · Stephen Nancekivell

Tech Meetup's and Presenting

I just gave my second presentation at wellington.js, and a friend asked why? Why present at the meetup? The first question should be why go? Why go?They are a good way to connect to other people interested in the same stuff. Its good to have those people to bounce ideas off. Meet people to start new projects with. You learn new stuff! Its way easier learning about something new when you can just sit back, listen, and ask questions....

September 12, 2013 · 2 min · Stephen Nancekivell

Testing with underscorejs

Underscore is an awesome functional javascript library but I think it needs a flush feature so we can easily test our applications that use it. A underscore.flush method would allow you to test the different cases without having to make your unit tests slow. This could work similar to angular.js's $httpBackend.flush(). Heres an implementation of what I mean....

July 1, 2013 · 1 min · Stephen Nancekivell

Server updates: Email notifications and 1-click Apply.

These days Im getting update notifications via email, and now applying those updates with one click. I've had email notifications for a while, But lately I got annoyed that'd have to login to my server and run the `apt-get dist-upgrade` command. I noticed that I wasn't even doing it. I was just ignoring the updates, which is not good practice! So I've turned the 5minute job of logging in and applying the update into a 1 second job....

June 1, 2013 · 2 min · Stephen Nancekivell

How I Sync to my mac to my android

I used to use SyncMe Wireless but now I have a mac and SyncMe doesnt support the afp file sharing protocol. So I run a ssh server on the phone and use rsync over ssh to sync the folders. This is a different approach. Instead of the phone asking the computer when the files have changed. I run rsync from my computer which connects to the phone and does the update....

January 27, 2013 · 1 min · Stephen Nancekivell

Adding version info to your javascript app

When deploying apps is helpful to know exactly what version your looking at. Where it might be the one on your server that you deployed months ago or the version you have checked out on your development machine. With java / maven applications you can configure the maven jar plugin to append this information to the  jar META-INF. I havent found anything like this yet for javascript / angular.js but its easy to craft a script to append it like this....

January 20, 2013 · 1 min · Stephen Nancekivell