Quick Tips Tutorials
Create Auth Tokens with PHP
Working with OAuth and similar authentication protocols requires the use of temporary tokens which represent unique handshakes between multiple web services. These tokens must be unique, securely stored, and the longer, the better. Since I've been out of the PHP game for a while, I was researching how to...
Command Line Polling
In an ideal world, we wouldn't have to poll for anything; we would always have events to trigger other functions. This isn't an ideal world, however, so it's important to know how to poll in multiple programming languages. I've covered JavaScript polling (with and without...
Prevent JavaScript Hotlinking with .htaccess
Almost a decade (!) ago I wrote a post about preventing image hotlinking. We all have the right to protect imagery hosted on our domain because it can slow our site down tremendously. I love that post because it shows you how to replace the...
Format Video Length in HH:MM:SS from Command Line
In my experimentation with audio and video manipulation, I've found that most tools prefer to handle time in HH:MM:SS (hour:minute:second) format. I always presumed that using seconds would be easier but I'm barely a novice media tool user, much less a tool creator. When I wrote the Create Short...
Scrape Images with wget
The desire to download all images or video on the page has been around since the beginning of the internet. Twenty years ago I would accomplish this task with a python script I downloaded. I then moved on to browser extensions for this task, then started...
Allow HTTP Push with Mercurial Server
I have always loved git but my present work at Mozilla requires me to use mercurial. If you weren't already aware, Firefox code is managed through mercurial! I was recently tasked with standing up a mercurial server within a docker container and ran into an issue: mercurial rejected pushes...
Unique Array Values
When you look at any programming language, you see missing features that you find puzzling because the use case seems so common. One such case is retrieving unique values from an array with JavaScript. Years ago I mentioned an easy way of unique value management using objects instead...
Slice Videos with ffmpeg
Isolating a specified portion of a video is a very common task for those who work within the media, probably using nice GUI tools to slice clips from the full video. I'm a developer, however, and know how amazing ffmpeg is so I prefer to do my basic video slicing from command...
Sorting Strings with Accented Characters
Strings can create a whole host of problems within any programming language. Whether it's a simple string, a string containing emojis, html entities, and even accented characters, if we don't scrub data or make the right string handling choices, we can be in a world of hurt. While looking...
CodeMirror: Set Focus at End of Line
CodeMirror is a WYSIWYG-like editor that allows for rich text editing on a small scale, oftentimes used to allow Markdown editing, much like ReviewBoard uses it for. One problem I've found, however, is that calling a CodeMirror instance's
focus
method put the cursor at the beginning of the input, which...