All Posts

NodeProgram in March, NYC

The NodeProgram weekend workshop taught by Azat Mardan was very well done. It was fast-paced and took no prisoners - not just familiarity but a minimal fluency with Javascript was assumed and required to keep up with the presentations and the exercises. I decided to attend both days of the weekend for a combined Sat+Sun of React and Node goodness. How else to productively spend a weekend?

Saturday : React

Saturday was devoted to React.js which I only had a passing familiarity with through osmosis (Hacker News, other fora). React is a very interesting model of front-end development and I thank Azat for helping me grok its fundamental nature - that of composability - the ability to compose components out of other components in a modular fashion. The urge to update the DOM through a quick jQuery function still nags my brain and will have to be trained out thru repeated React usage. We ended up working on Nodeschool ‘learnyoureact’ workshop between presentations of theoretical explanations. Mentors were available to assist people with their challenges and Azat walked around helping a lot as well. There was a supplementary presentation on React Native, which I paid minimal attention to as I’m not currently focused on building mobile apps and even when I play around with Swift on iOS, it’s good to have a solid understanding of a platform before (potentially) ruining one’s understanding with frameworks.

Sunday : Node

Azat emphasized repeatedly the asynchronous nature of Node.js, which was our topic for Sunday. The format of the day was similar to Saturday’s with working on Nodeschool workshops (learnyounode, ExpressWorks, learnyoumongo) interspersed with theory and explanations of Node.js, Express.js and the usage of MongoDB with Node and Express. As I’d earlier played around with Node back in 2012 (but, regrettably hadn’t followed it through to a major project), I was aware of some of the basics but Azat’s explanations solidified my understanding and I’m excited to build on top of my newly acquired knowledge.

I find it worthwhile to mention that Azat has a personality. He not only delivers good presentations and helps with one’s code, but also describes various scientifically tested learning strategies such as spaced repetition. He clearly keeps up with the learning geekosphere online! He also took the liberty of filling the ‘space’ in our spaced repetition with a quick foray to introduce meditation! Enjoyable and unique.

Overall, NodeProgram has reinforced my belief in hard, weekend workshops - it’s the ideal way to get a quick, rigorous introduction to a new technology - far more sticky in my mind than going through a dozen tutorials online. One can’t discount the serendipity of meeting great people either.


Speaking of Javascript, I recently across this surrealist talk delivered by Gary Bernhardt titled The Birth and Death of Javascript. The futuristic retrospection delivered by Bernhardt is superb and truly mind-bending. It uses the mechanism of comedy to sneak in some pretty radical but feasible ideas for the evolution of Javascript and all programming 25 years from now. Do watch it!

written learning

Pecunia Nunc Is Live!

A few months ago, I came across this:

The link in the above tweet was to this:

As I was and am interested in working for Kickstarter, and was looking to shore up my portfolio, particularly with Ruby projects, I decided to take on the project.

After many false starts, I present to you…drum roll please

Pecunia Nunc

The idea is to send a daily digest of Kickstarter projects that fit a certain criteria to subscribers, such as - The projects are close to the finish line (>80% of goal funded) - The projects are ending soon (within 48 hours)

I believe this will enable Kickstarter enthusiasts who don’t have time to browse the many interesting, worthy projects regularly to fund them when they most need help. Scanning the email in the morning takes 10-15 seconds, or more if you happen to find a project to like.

I hope I’ve fulfiled a need. If not, there’s always next time.


written pecunia-nunc, side-projects

I’m Not a Spammer

For my current side-project, I need to send emails to a list of people whose email addresses are stored in the database. My concern, as you can imagine, is to prevent spamming my users in instances of error or otherwise. There’s several ways to do this. As usual, it comes down to a choice - a judgement call from among the many choices.

  1. Creating an emails model to keep track of when an email was sent and to whom.
  2. Storing the last time a user received an email in the user model.

You can think of many others ways to do this of course. I decided to go with the second option as it required minimal effort and has so far turned out very well. This was accomplished with a single rails generate migration AddLastEmailToSubscribers last_email:datetime.

This will create the following migration

class AddLastEmailToSubscribers < ActiveRecord::Migration
  def change
    add_column :subscribers, :last_email, :datetime

From here, I can simply check if the :last_email is nil or a day before today’s, and if so, then send the day’s email, and then update the last_email to


written learning, pecunia-nunc, ruby, side-projects

Down With the Sickness

This is me for the past week

Really need to get a lot of work done including all the side projects, but gah sometimes biology comes in the way. Damn you Rotavirus.

written setbacks

Redirect_to and Preservation of Errors

Working on my side project, Pecunia-Nunc, I was baffled when the errors on the object creation form would not display upon submission. The controller looked like this

class SubscribersController < ApplicationController

def new
  require 'digest'
  @subscriber =[:subscriber])
  @subscriber.token = Digest::SHA1.hexdigest([, rand].join)
      flash[:notice] = "Thanks for signing-up. Please confirm your email address through the email that'll be in your inbox shortly!"

      redirect_to home_path
      flash[:notice] = "There were errors! Please resubmit after making corrections."
      redirect_to home_path
end ...

The view :

  <% if @subscriber.errors.any? %>
  <div id="error_explanation">
    <div class="alert alert-error">
      The form contains <%= pluralize(@subscriber.errors.count, "error") %>.
    <% @subscriber.errors.full_messages.each do |msg| %>
      <li>* <%= msg %></li>
    <% end %>
<% end %>

As you can tell, the problem was not in the view at all, but in this line redirect_to home_path. Redirection clears the object.errors field, and therefore nothing was being displayed. I stupidly spent a lot of time fiddling with the view, instead of inspecting the controller action. Replacing the problematic line with render 'new' (‘new’ is the action/view that renders the form) solved the problem by preserving the .errors object.

written debugging, pecunia-nunc, side-projects

Me Encanta Duolingo!

I’ve been playing with Duolingo for around a month, specifically with the Spanish module. It’s absolutely fantastic. I’d signed up for an invitation back in the day as I tend to sign up for any new startups or services I think may be cool to try out. I had as much interest in learning Spanish at this time as I do in learning to bake, which is in the category of ‘it’d be nice but i have other things to do.’ Since trying it out, I’ve been totally hooked! The feeling engendered by the act of proper recollection is deeply satisfying. I can’t say I recall much of anything I learned in French or Arabic classes back in school and I did those for 2 and 3 yrs respectively. But I was able to recall words, sentences and even basic verb conjugations just two days after starting Duolingo.

So, if you have any interest at all in learning Spanish, French, Italian, German or Portuguese (these are the available modules currently), click over to Duolingo, you’ll thank me later.

Oh, did I mention it’s absolutely free?

written duolingo, language-learning, learning, spanish

Pow Environment Variable Trouble

I was caught up in excitement upon discovering pow. After setting it up, and testing it out on the project I’m working on now, I encountered a problem. My app is setup to send email using Gmail thru SMTP configured in a Rails environment config, and the email is sent using ActionMailer.

The config looks like this

address: "",
port: 587,
user_name: ENV["GMAIL_USERNAME"],
password: ENV["GMAIL_PASSWORD"],
authentication: :login

The emails were arriving when I tested the app by running rails server but on the local pow server, authentication errors were the norm. Clearly the environment variables weren’t being set. So I googled pow’s documentation for how to setup environment variables, ending up on this page. While reading through the linked section, I missed something critical.

“Pow attempts to execute two scripts — first .powrc, then .powenv — in the application’s root. Any environment variables exported from these scripts are passed along to Rack.”

So I idiotically set about creating a .powrc file in my user/bin directory. Obviously this did not work, but I wasted an hour or so tweaking random settings trying to get this to work. Then I re-read the page, set about to fix the problem, which I did as follows.

  1. Run touch .powrc in my project’s root.
  2. Edit .powrc and add the environment variables as follows: export GMAIL_USERNAME=username export GMAIL_PASSWORD="my password"
  3. Restart pow’s worker for the app by running touch tmp/restart.txt

And that worked!

written bugs, environment-variables, pow, projects, rails

Bam! Pow!

Pow is awesome

I understood the obsessive focus of talented hackers on customizing and shortening every part of the development workflow, including reducing one word (5 letter) commands to 2 letter commands, in an intellectual manner, but I hadn’t felt it, till I started experimenting with Rails development. Typing rails s every minute can get old. This is where pow along with powder have been awesome. Now when I create a new rails app, I just run powder link to create a pow dev server for my app. Now, whenever I feel like testing out my app in the browser, I just launch powder open and the app is served in the browser. This replaces launching the rails server, followed by switching to the server and navigating to localhost:3000.

So, I want to end by thanking the 37Signals dev team, along with Adam Rogers and Phil Nash for making my life easier.


Nature’s Complexity, Human Incomprehension

From the Enlightenment onwards, we humans have betrayed a supreme confidence in our ability to read, interpret, deconstruct and ultimately triumph over the natural world using nothing but our faculties of reason, through their manifestations in science, technology and philosophy.

Okay that sounded way too high-brow. Nonetheless, I just came across this awe-inspiring post at High Scalability.

A creature as ‘simple’ as a slime mold is capable of amazing feats of computation by following simple rules that Nature has granted it through evolution. I don’t know whether scientists have deconstructed slime molds down to individual proteins and built up a whole model of it, though that seems unlikely and complex. And that’s the point! The organization and structure of a slime mold, though simple compared to multi-cellular organisms like us, is still extremely complex for our minds to deconstruct through observation and reason. There’s logic embedded in the structural complexity of the natural world not wholly visible to us.

Since I haven’t yet tried ‘genetic programming,’ I don’t know how effective it is in adopting nature’s solutions to some computation problems, nonetheless I should give it a shot sometime, perhaps using this book on HackerShelf

written Complexity, Embedded-Knowledge, Nature, Optimization

Learning, Muscle Memory, Typing

Going through Zed Shaw’s Learn Ruby the Hard Way, I now recognize the importance of typing in the context of learning to program a new language. My professional experience in software development consisted of .NET development in C#, which is extremely similar to JAVA in syntax. So, upon encountering Ruby syntax elements such as pipes ‘|’, typing the code becomes slow due to a lack of practice, which impedes and constricts thinking.

Exercise 12: LibrariesSource Article
require 'open-uri'

open("") do |f|
  f.each_line {|line| p line}
  puts f.base_uri         # <URI::HTTP:0x40e6ef2 URL:>
  puts f.content_type     # "text/html"
  puts f.charset          # "iso-8859-1"
  puts f.content_encoding # []
  puts f.last_modified    # Thu Dec 05 02:45:02 UTC 2002

Typing code like the excerpt above has developed muscle memory for me, and made me think of solutions faster, just as Zed said it would.

Happy typing!

written learn-ruby-the-hard-way, learning, ruby, typing


BRB, learning Ruby…

written ruby

Hello World

Hello World! I’m baaaaaackk.


Retina Aches

I wonder if any other MacBook Pro with Retina display owners have noticed tiring of the eyes to a further extent than regular laptops (including MacBooks). There seems to be more of an intense focus engendered by the Retina screen. The closest analogue I can think of is maybe watching a 3D movie.


Start-up Tour – 10gen

Attended a fun event called “Start-up Tour.” This involved visiting the offices of 10gen, Thrillist and Foursquare. They shoved tons of food down our throat. I was impressed with the quality of the food. As a participant in the tech scene, one’s culinary choice is often limited to pizza and beer but in this instance we were treated to high quality charcuterie at 10gen and decent taco fillings at Foursquare.

Presentations All the presentations came across as genuine without many marketing phrases that such events are usually full of.

  • 10gen

The slide deck presenting Mongo was only partially informative. Many people who have no clue what ‘NoSQL‘ actually means would not have understood ‘document storage’ vs relational databases either. Some code samples would have helped.

Tyler Brock, who is responsible for the Ruby driver for MongoDB delivered the presentation. Incidentally, I’d just attended the NYC.rb Hackfest meetup the previous day where I’d met a cool dude named Bent Cardan who helped me get my new MacBook Pro setup with ZSH and iTerm and gave me a full demo of agile hacking on rails with Mongomapper which is an open source community-developed ORM/ODM for MongoDB. This prompted me to ask Tyler whether an ‘official’ ODM solution was on the way for MongoDB on Rails/Ruby. Interestingly enough, Tyler mentioned that he wanted to do an ODM and that since he’s in charge of Ruby driver dev, it would probably happen though not anytime soon.

  • Thrillist

I was surprised that the presentation had no screenshot of Thrillist or JackThreads sites as they are very hip and cool and people unaware of them would certainly have enjoyed them. The description of the various Thrillist sites was mostly abstract with very few examples thrown in.

This was followed by an enjoyably geeky description of the workflow and design process of a recent project within the company that involved handling user data on the various Thrillist Media sites. Detailed block diagrams illustrated the way they’d used lots of components – MongoDB, Redis, MySQL, nginx/unicorn, etc. I was hooked! My takeaway was the line, which I paraphrase as “When you are creating a universal API, everyone’s your enemy.” A succinct crystallization of the issue of defensive programming.

  • Foursquare

This presentation was the most statistics-heavy. Details included number of user check-ins and venues among others and the numbers were impressive. The CTO was the presenter and he gave us an overview of the scaling challenges that Foursquare faces. The part I found interesting was when he mentioned that since all history of a user’s activity is important in the future, the scaling challenges are very different from, say, Facebook or Twitter where past tweets or messages are mostly not accessed at all.


All the offices were open-space as expected but each had a different feel to it.

The 10gen offices felt linear and uncluttered. It was basically a rectangular layout with window views of SoHo on each end. A decent amount of natural light.

Thrillist offices felt like giant male dorm rooms with crazy posters including those of semi-naked girls on the walls, funny artifacts thrown about everywhere and a collegial atmosphere.

Foursquare’s main lobby is an atrium with very high skylights. The conference rooms are boxed inside very glossy um glass and hold iPads next to the doors with the schedule information. Overall the offices felt airy and calm but perhaps the Zen-like affects were due to the relative emptiness of the place.


An eclectic mix of people attended, though only eclectic in the tech scene not in a universal sense. Ran into a few people I know including a friend. The Thrillist people seemed to be the most laid back. 10gen technologists oozed C++ (hard to explain) while Foursquare devs looked like determined project deathmarchers.

Overall, a fun and interesting experience, highly recommended!


Puts ‘Hello World’

I just thought it’s time to get online in a serious way and document my journey as I learn new programming languages, frameworks and tools. Also expect an odd thought or two on economics.