How to dynamically load the date in Jade using Javascript's Date()

Problem I need to add the current year in a footer for the copyright, just like you can do with PHP. But, I'm using Node + Express + Jade templating. Jade loves Javascript Sometimes I forget, but Jade evaluates raw Javascript. Frequently I use it to evaluate the locals variable for dynamic…

Quick Way to Remove a Single Line from a File From the Command Line, Linux / Mac

The Problem Our stack typically requires recreating our staging servers a lot. By default, Mac OSX throws a security error if the IP address of the computer that you are trying to log into leads to a different computer than the last time you logged in. Something like this: >…

One Page Nav, scrollOffset Workaround Without Top Padding

The Problem For the new Pilot site, we are using the clean and quick One Page Navigation jQuery plugin from Trevor Davis. In older versions of the site, the previous dev had used scrollOffset config feature. However, I wanted to use an updated version, and Trevor warned in several issues…

Conditional Parents in Jade

The Problem: I need to decide which parent to insert based on a conditions. However, whatever the condition, they should both have identical children. Jade does not have an end like Ruby or a fi like bash. And if you simply add another space like you would expect, then only…

How to Remove a Marker Google Maps JavaScript API v3

This, I thought, was not intuitive. In order to remove a marker that you have placed on a map, you need to reset its map, particularly to null. Like so: markerToBeRemoved.setMap(null); …

If You Build It, (Make Sure) They Will Come

Easy lesson learned today. For my new venture, we put together a Magic Test to determine if people would signup, according to the Lean Startup methodology preached by Erci Reis. We put together a simple LaunchRock site in the beginning for sellers. But, since we were building a marketplace, we…