code

Helper Function .bindAll

Helper Function .bindAll 150 150 Clark

Like most JavaScripters, I often find myself needing to manually control the this-binding of a function on invocation. Event handlers and callback functions are often re-bound to a different context than the caller — meaning that if those event handlers or callbacks reference this, they might be referencing the wrong object.

read more

The Usual Utility Functions in 2kb, Unminified

The Usual Utility Functions in 2kb, Unminified 150 150 Clark

I have now been able to remove Underscore.js, Ramda, and Lodash from the dependencies of multiple projects, by using the following underramdash.js helpers. Note, this file is 2kb unminified and unzipped, whereas Underscore.js is 52kb unminified and unzipped…

read more

Printing from Streams with sed -n '/pattern/'p

Printing from Streams with sed -n '/pattern/'p 150 150 Clark

I like to think of the Unix command-line utilities as though they were interesting characters — it helps me remember the different command switches based on each command’s personality. sed is my simple and obedient search hound. He has a single input — his hound-dog nose. He can match patterns…

read more

CoffeeScript Polyfill for Function.prototype.bind

CoffeeScript Polyfill for Function.prototype.bind 150 150 Clark

Recently, I needed to polyfill Function.prototype.bind to use with PhantomJS. The project I was working on was written in CoffeeScript, so I rewrote the MDN Function.prototype.bind JavaScript polyfill in CoffeeScript. To use the polyfill, just add the above snippet wherever needed.

read more

An Introduction to Injection, XSS, CSRF, and Practicing Safe Security

An Introduction to Injection, XSS, CSRF, and Practicing Safe Security 150 150 Clark

Every user of your web app is trying to break it In this post, we will discuss practical web security. We will start by covering the who — who you need to protect against. Next, we will cover the what — what common exploits you need to know about and…

read more

Getting Started with webpack

Getting Started with webpack 150 150 Clark

I work with a guy named, Raghu Kasturi. This talented buddy of mine shared a tutorial with us — getting started with webpack. We will learn about webpack, why we might use webpack, and finally, how to actually use it to enhance our work. The following knowledge-bombs and practical tutorial…

read more

5 Mins to Deployment – Ubuntu and PostgreSQL on Digital Ocean

5 Mins to Deployment – Ubuntu and PostgreSQL on Digital Ocean 150 150 Clark

My friend and talented colleague, Ryan Leung, wrote this guest tutorial on deploying to Digital Ocean with an Ubuntu and PostgreSQL setup. The following step-by-step guide is from Ryan… Deployment with Ubuntu and PostgreSQL on Digital Ocean By Ryan Leung Recently, I had to deploy a project that used PostgreSQL…

read more

Sudoku Solution Validator

Sudoku Solution Validator 1030 1030 Clark

Five months ago, I was asked to solve a problem with a pair — the challenge was to write a Sudoku solution validator. We were expected to take a two-dimensional array that represented a Sudoku board and determine whether or not the board was ‘solved’ based on the rules of…

read more

String Primitives and String Objects in JavaScript

String Primitives and String Objects in JavaScript 150 150 Clark

My friend and talented young Software Engineer, Paulo Diniz, wrote this guest post to explain the difference between String Primitives and String Objects in JavaScript, and what that might mean to a JavaScript programmer. The following is from Paulo… JavaScript String Primitives and String Objects By Paulo Diniz Throughout this…

read more

Variable Hoisting and Function Hoisting in JavaScript

Variable Hoisting and Function Hoisting in JavaScript 150 150 Clark

In JavaScript, both variables and functions are hoisted by the interpreter at runtime. However, variables and functions are not hoisted in the same way as each other.

read more