Avishaan Sethi

Dokku ipaddress:port based access without VHOST

A common use case is to use Dokku without an actual domain. I address how to use a consistent external port with an ip address since the docs don't.

Dokku isn't clear how to host a server when you don't have a domain you want to use. If you don't enable their vhost by default then the external port of your app CHANGES EVERY DEPLOY. They only describe in detail their http://subdomain.domain.com deploy. Here I show you how to use the http://ipaddress:port deploy in a consistent . . .

Read More

Posted in: dokkunodejs

September 15, 2015

Fast Logical UIScrollView in Swift

UIScrollView is something that can be very confusing because it uses constraints in a way that they aren't normally used. Because of this there is so much confusion.

Implementing a UIScrollView is actually really easy when you know/do three fundamental things. There is a video I uploaded that walks you through this process UIScrollView Video but incase you forget you can use the following as a reference.

  1. Use a View (let's call it, ContentView) in your ScrollView to keep the layout of . . .

Read More

August 19, 2015

Single(ton) Swiftly

Two design patterns which can be used to implement Singletons in Swift.

The Singleton pattern makes sure only one instance of a given class exists. Usually that single instance is lazily loaded when it is needed. There are a bunch of examples of this built into iOS such as:


I'm not going to tell you when you might need . . .

Read More

Posted in: ios8swift

August 17, 2015

MeteorJS Quick Deploy

Quickly deploy MeteorJS to your own provider or services like Digital Ocean.

In this example we will talk about a quick deploy technique for MeteorJS apps. I recommend using Digital Ocean for this deployment example but any Nix based server should work.


I assume you already have npm installed. If you don't go ahead and get npm installed from here: . . .

Read More

August 13, 2015

Attributed Strings in Xcode ~6.x with Custom Font

Attributed strings build in the storyboard editor which use a custom font does not render correctly. Here are the steps to get around it.

When setting attributed text in Xcode storyboard editor you will find that any custom font selected will show up in the storyboard, but not when run in the simulator.


Silvrback blog image

Online people talk about making sure you add your custom fonts to the plist or to make sure you aren't picking a font style that the font . . .

Read More

Posted in: ios8swiftxcode

July 18, 2015

Callback before, Promise after

Transliteration between callback and promises by example.

Sometimes when you see enough examples, things just click. I have multiple examples that show you an implementation (before) and then an alternate implementation using promises (after).
Note: Keep in mind that different libraries have different implementations but these should all still be relevant;

Here are some before and . . .

Read More

April 05, 2015

Learning Promises via a Story

Learn the basic idea of promises in Javascript by listening to this story.

What is this about?

Any language/concept/idea is easier to learn when you come up with a relatable real life situation or metaphor. Programming is no different. I'll use the next few minutes to build up a simple promise example that you can run and play with while telling a memorable and relatable story.
My purpose here is to . . .

Read More

Posted in: javascriptnodejs

March 08, 2015