Julian Tescher

Founder and Engineering Lead at WillCall

Read this first

Getting Started With Scala Development

Scala Logo

Learning new languages can be a great way to expand your skills and stay up to date with software development trends. The language that I’m currently learning is Scala! It’s a great language for picking up functional programming concepts, and it being on the JVM allows you to leverage the Java ecosystem’s libraries and frameworks. In this post I’ll show you how to install Scala and give you a few resources to get you started.

 Installing Scala

To install Scala you need to install a Java runtime version 1.6 or later. Once you have that installed you can install Scala through homebrew if you are on a mac, or follow these instructions if you are not.

$ brew install scala

 Using Scala

You can get started playing with the language basics from the terminal with the scala command.

$ scala
Welcome to Scala version 2.11.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in
...

Continue reading →


Writing Command Line Applications In Ruby With Thor

Writing small command line utilities and bash scripts can save you a lot of time as a developer. People often don’t take
advantage of them though because they feel intimidated and confused by the ones they use every day like $ git status
or $ rails new and it seems like there is just too much to learn. While it’s true that some utilities are pretty
complicated, writing simple scripts is fairly painless and can help you greatly with repetitive tasks or when using an
application that doesn’t need a graphical interface.

In this post I’ll show you how to create a simple calculator app/utility starting from in-line shell scripts in ruby and
moving up to using the Thor gem. Even though my examples with Thor are pretty simple,
it can be used to build quite powerful and expressive projects like the Twitter CLI and
the Rails CLI.

I’m going to use a simple calculator with just add and...

Continue reading →


Basic Rails API Caching

Rails performance out of the box is acceptable for prototypes and small applications with limited traffic. However as
your application grows in popularity you will inevitably be faced with the decision to either add more servers, or use
your existing servers more efficiently. Complex caching strategies can be incredibly difficult to implement correctly,
but simple caching layers can go a long way.

In this post I’ll explain two basic Rails caching mechanisms and explain some of the costs and benefits of each.

 HTTP Caching

If your API responses are mostly static content like a list of available products, then
HTTP Caching can be a very effective solution. Even something
as low as a one minute cache can move the vast majority of your requests to a CDN like
CloudFlare or an in-memory store like
rack cache.

Specifying the expiration time is simple. In your controller action just call ex...

Continue reading →


Building A Go Web App with Revel on Heroku

I’ve been interested in Go for a long time now. The language has lots of aspects that make it well suited for building
modern web applications including its powerful standard library, concurrency primitives, and
impressive performance benchmarks. The community is also gaining a lot of
ground in terms of tooling, web frameworks, and other resources for creating sites in Go.

In this post I will show you how to create a basic app in Go and how to host it on Heroku.

If you do not have Go installed on your system, you can do so on a mac with $ brew install go or follow the
instructions here. Also if you’re interested in learning the basics of Go,
be sure to check out A Tour of Go.

If you get stuck you can find all of the code for this post at
github.com/jtescher/example-revel-app.

 Creating a Revel App

Revel Logo

Revel is a high-productivity web framework for the Go language. It has an impressive...

Continue reading →


Creating A Metrics Dashboard With Ember.js, Bootstrap, and Rails - Part 3

This is part three of a series on building a metrics dashboard with Ember, Bootstrap, and Rails. Over the next few weeks
I will be building out more functionality and writing posts to cover that. If you haven’t read
part one and
part two then that’s a good place to start.

In part two we ended up with an Ember app that rendered
dynamic tables. If you followed along, your page should now look like this:

Part Two Final

Today we’re going to add some graphs and see how Ember components work.

Remember, if you get stuck you can find all of the code for this post at
github.com/jtescher/example-ember-rails-dashboard.

 Choosing The Right Library

Highcharts Demo

There are many good options when it comes to JavaScript graphing, charting, and visualizations. I find
highcharts to be a good place to get started and it is free for non-commercial uses!
If you find yourself needing more control or having a very specific...

Continue reading →


Creating A Metrics Dashboard With Ember.js, Bootstrap, and Rails - Part 2

This is part two of a series on building a metrics dashboard with Ember, Bootstrap, and Rails. Over the next few weeks
I will be building out more functionality and writing posts to cover that. If you haven’t read
part one then that’s a good place to start. You can find
part three here when you are finished.

In part one we ended up with a Rails app that generated
the Ember app that rendered our metrics page. If you followed along your page should now look like this:

Part One Final

Today we’re going to add some tables and see how data flows through an Ember app. If you are not familiar with Ember’s
conventions and idioms you should first read their
excellent documentation and guides before continuing here.

Remember, if you get stuck you can find all of the code for this post at
github.com/jtescher/example-ember-rails-dashboard.

 Preparing the application

Before we add any more content let’s...

Continue reading →


Creating A Metrics Dashboard With Ember.js, Bootstrap, and Rails - Part 1

This is part one of a series on building a metrics dashboard with Ember, Bootstrap, and Rails. Over the next few weeks
I will be building out more functionality and writing posts to cover that. You can find part two
here.

There are some services that will provide dashboards and visualizations for you like
Geckoboard, but once you need to provide custom analytics and graphs to clients or
co-workers you will need something a little more flexible.

Today we’re going to assemble the first pieces of this app by creating a Rails server, an Ember.js App and some basic
Bootstrap styling.

You can find all of the code for this post at
github.com/jtescher/example-ember-rails-dashboard.

 The Rails Server

We want to be able to expose all of our stats from various internal and third party services with a consistent API so
this server will primarily handle authentication and data transformation...

Continue reading →


How to keep your data consistent with foreign key constraints

Datacenter

We all have that co-worker (and have been that co-worker) who SSHs into a
server and runs SQL statements against live data. On staging servers this
can be a minor issue if things go wrong, but in production it can be disastrous.
At WillCall we often have to spend time
putting our staging data into different configurations for testing purposes
and have felt the pain of inconsistent data more than once.

Today we’re going to talk about data consistency, why keeping your data
consistent is always a challenge, and what you can do about it.

Integrity issues can creep in unintentionally if you do not have a
deep understanding of how ActiveRecord callbacks and validations work and
which methods skip them entirely!

For example if you have a Post model and each Post had many Comments, when you
call post.destroy with the dependent: :destroy option, it will destroy the
associated comments as...

Continue reading →


How to set up a Rails 4.1 app on AWS with Elastic Beanstalk and PostgreSQL

AWS Elastic Beanstalk

Update: This post is now a bit outdated. There is a
NEW VERSION
of this post that has updated instructions for the new Elastic Beanstalk and Rails 4.2.

Managing ops on a small team can be a real pain. At WillCall our infrastructure is
pretty simple but we still have to spin up and down lots of servers every day to handle the varying traffic across our
services. Three years ago when we had just started the company we were doing this manually with
chef, but it could be error-prone and started to feel like a full-time job.

For simple projects, tools like heroku can be perfect. Great for prototyping apps and testing
out different ideas without a lot of hassle. But when your project gets more complicated and you want to have more
control of your servers, load balancers, workers, auto-scaling conditions, etc, you will feel this pain as well.

There are many services that provide the...

Continue reading →