Fill an Array with Sequential Values

I’ve been contributing to Mozilla’s awesome DevTools debugger because, well, I want to give back to the Firefox Engineers and all the developers who have stayed loyal to Firefox.  Having my hand in loads of Mozilla projects is really satisfying, especially for my ego. In any event, one task required me to fill an array […]
The post Fill an Array with Sequential Values appeared first on David Walsh Blog.

Link: https://davidwalsh.name/fill-array-javascript

Create a Waveform Image with ffmpeg

Waveform images have a variety of uses and I’ve started seeing waveform images overlaying at the bottom of videos.  That type of feature seems useful if you want to see identify music in a video or specific spaces in a video which feature action.  If you’re creating an audio-centric app, you may have a dozen […]
The post Create a Waveform Image with ffmpeg appeared first on David Walsh Blog.

Link: https://davidwalsh.name/waveform

Undo File Changes with Git

One of my favorite features in modern text editors is their ability to integrate tools to format code upon every save.  When you’re working on legacy projects, however, auto-formatting can be a problem; if you open a file that you don’t explicitly change, the file may still get modified by the formatter.  This all leads […]
The post Undo File Changes with Git appeared first on David Walsh Blog.

Link: https://davidwalsh.name/git-undo

Add CSS and JavaScript Files to Phabricator Extensions

Every open source framework has its own methods of extending functionality; some make extending incredibly easy and others…not so much.  Most of the time it comes down to how well the framework is documented.  Phabricator did an awesome job of making necessary classes extendable but it’s fair to say it would be great if the framework had a bit […]
The post Add CSS and JavaScript Files to Phabricator Extensions appeared first on David Walsh Blog.

Link: https://davidwalsh.name/add-css-javascript-files-phabricator-extensions

Create Aliases in Bash

Every developer likes a shortcut — they’re what make us more efficient in our work.  Of course there are good shortcuts and bad shortcuts (lazy coding, lack of security review, etc.), but let’s stick with the positive and talk about a good shortcut:  bash aliases. We all have commands that we execute regularly but aren’t able to remember […]
The post Create Aliases in Bash appeared first on David Walsh Blog.

Link: https://davidwalsh.name/alias-bash

Create GitHub Pull Request and Issue Templates

There’s nothing more frustrating than getting an incomplete bug report.  I’ve often seen bug reports containing a useless “{x} feature doesn’t work”; no steps to reproduce, no URL, no browser or device information, just a hopelessly vague message.  Similar is receiving a pull request or patch which doesn’t state its intent and doesn’t provide steps to test […]
The post Create GitHub Pull Request and Issue Templates appeared first on David Walsh Blog.

Link: https://davidwalsh.name/github-templates

Track Empty Directories with git

There are times when you’d like to track an empty directory within git but there’s a problem: git wont allow you to add a directory that doesn’t have a file in it.  The easy solution is putting an empty stub file within the directory, and the industry standard for that stub file name is .gitkeep. You […]
The post Track Empty Directories with git appeared first on David Walsh Blog.

Link: https://davidwalsh.name/git-empty-directory

Get Keychain Passwords from Command Line

One of my favorite command line utilities is Guillermo Rauch’s wifi-password, a utility that allows you to get a saved password for the wifi network you’re presently connected to (to share with colleagues or creeper in the cafe you’re in).  The idea of being able to get a password from command line is super useful, especially […]
The post Get Keychain Passwords from Command Line appeared first on David Walsh Blog.

Link: https://davidwalsh.name/keychain-command-line

Get Python Requirements Package Hashes

Python’s (pip’s) requirements.txt file is the equivalent to package.json in the JavaScript / Node.js world.  This requirements.txt file isn’t as pretty as package.json but it not only defines a version but goes a step further, providing a sha hash to compare against to ensure package integrity: Flask==0.12.1 \ –hash=sha256:6c3130c8927109a08225993e4e503de4ac4f2678678ae211b33b519c622a7242 Jinja2==2.9.6 \ –hash=sha256:2231bace0dfd8d2bf1e5d7e41239c06c9e0ded46e70cc1094a0aa64b0afeb054 MarkupSafe==1.0 \ –hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665 …. Coming from the JavaScript / package.json world, you […]
The post Get Python Requirements Package Hashes appeared first on David Walsh Blog.

Link: https://davidwalsh.name/hashin