Quick Tips Tutorials
DOMDocument and UTF-8 Problem
A few weeks back I shared how I used PHP DOMDocument to reliably update all image URLs from standard HTTP to HTTPS. DOMDocument made a difficult problem seem incredibly easy ... but with one side-effect that it took me a while to spot: UTF-8 characters were being...
Adding ESLint with gulp.js
I've noticed that I am a loose coder on my personal projects but want some level of decorum on Mozilla and other open source projects. The more developers you have contributing to a project, the tighter the ship you must keep. The easiest way to do that is...
Catching Fatal Errors with Node.js child_process
I'm relatively new to hardcore Node.js hacking so I'm seeing all sorts of lovely new errors that I have no clue how to solve when I initially see them. To this point I've managed to keep a smile on my face while trying to fix these...
Detect Function Argument Names with JavaScript
I was recently looking over the promisify-node code to see how the author was able to convert basic functions and objects to a promised-based API. I quickly realized that they were reading function signatures to look for common callback argument names like
callback
andcb
.Scroll to Element within CKEditor
CKEditor is the outstanding WYSIWYG editor we use on the Mozilla Developer Network. We have many custom plugins and we do everything we can to make writing easy for contributors. One trick I just picked up was skipping to an element within the editor by ID and setting the...
Access Native Node.js Modules within Intern
Intern is an awesome unit and functional test suite from SitePen. I've been using this utility extensively over the past year, writing tests to make sure MDN's front-end is in good shape after code merges and pushes. Sometimes when writing tests I'll want to make use of a node...
Create a Repository Archive with git
Everything about git is amazing. And by "everything", I mean almost everything. As someone that used Perforce and SVN before learning git, I'm willing to ignore a few git annoyances since it makes branching and many other simple tasks easier. One good problem I have...
Get Directory Size from Shell
My first goal when coding is usually to make it work and then clean up the code into a more maintainable format. Many people prefer to keep code clean from start to finish but thinking "maintenance first" slows me down --- I like to GO GO GO!
Get Git Branches Checked Out on a Date
I don't use any type of git UI -- I try to be hardcore and stick to the command line. This makes git usage quicker but I also probably miss out on a lot of the functionality that would be nice to know. The functionality is there, of course...
Recursively Delete Files from Command Line
I'm one of those people who can't stand a messy laptop; I don't keep around files I don't need and I refuse to install apps unless I absolutely need them. Unfortunately Mac OS X and Windows generate files whenever they like, like
.DS_Store
andThumbs.db
. Sure they serve their purpose...