JavaScript waitForever

Writing mochitests for new features in DevTools can be difficult and time-consuming.  There are so many elements interacting in an async manner that I oftentimes find myself using the debugger to debug the debugger!  In the case where it’s unclear what interaction isn’t working properly, I find myself going to a neat utility function: waitForever.  […]
The post JavaScript waitForever appeared first on David Walsh Blog.

Link: https://davidwalsh.name/javascript-wait

Get Viewport Lines and Columns in CodeMirror

CodeMirror is an amazing utility for presenting code in a browser environment.  Syntax highlighting, widgets, and a number of advanced functions make it a unique, useful tool.  When using CodeMirror inside the Firefox DevTools debugger, I found that adding hundreds of column breakpoint widgets to very long lines of code really killed performance, and I […]
The post Get Viewport Lines and Columns in CodeMirror appeared first on David Walsh Blog.

Link: https://davidwalsh.name/viewport-lines-columns-codemirror

Replace Last Command in Shell

Whether I fat-finger a command or my MacBook Pro keyboard’s keys don’t want to respond like they should, I’m frequently misspelling commands.  What’s more frustrating is that many of these commands are long, taking making fixing theme time-consuming. Luckily a Twitter follower is looking out for me, providing me a quick command for fixing the […]
The post Replace Last Command in Shell appeared first on David Walsh Blog.

Link: https://davidwalsh.name/replace-command-shell

Object.fromEntries

The Object object has been buffed with useful methods over the past few years.  Object.keys, Object.values, Object.freeze, and Object.assign all address frequently desired functionality.  One of the new Object methods is fromEntries, which accepts a Map or map-like array nesting and converts it to a useful object literal! Convert Map to Object Converting a Map to a key:value […]
The post Object.fromEntries appeared first on David Walsh Blog.

Link: https://davidwalsh.name/objectfromentries

Download a YouTube Channel’s Videos

YouTube is an endless source of entertainment, be it stuff you’re proud to share you like or stuff you would rather others not know about (see: David’s history of watching old WWE Royal Rumbles).  I watch a lot of YouTube in hotels and on flights when I don’t have internet access, so I use youtube-dl […]
The post Download a YouTube Channel’s Videos appeared first on David Walsh Blog.

Link: https://davidwalsh.name/download-youtube-channel

Turn Bluetooth On and Off from Command Line on macOS

Bluetooth has been a revelation in wireless technology: wireless mice, headphones, streaming devices, and a variety of home and office environments.  It goes without saying that wireless peripherals are so much easier to manage than wired counterparts, especially mice, that I usually have my MacBook’s bluetooth turned on. There are times, however, that I move […]
The post Turn Bluetooth On and Off from Command Line on macOS appeared first on David Walsh Blog.

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

Mercurial: Mass Add and Remove All Files

While I much prefer git and the GitHub workflow, Firefox’s codebase (mozilla-central) is store in a mercurial repository.  There are tools that wrap mercurial so you can use a git-like interface, like git-cinnabar, but my philosophy is to learn the root tool so that I know what’s going on every step of the way.  Imagine […]
The post Mercurial: Mass Add and Remove All Files appeared first on David Walsh Blog.

Link: https://davidwalsh.name/mercurial-mass-add-remove-files

Change Mac Brightness from Command Line

Earlier this week I posted about how you can modify your Mac’s volume from command line.  Little command line scripts make me smile because I spend so much of my day in command line, and automation can be the key to productivity.  I next thought about modifying brightness from command line and I found out […]
The post Change Mac Brightness from Command Line appeared first on David Walsh Blog.

Link: https://davidwalsh.name/mac-brightness

Find and Change Default App for File Type from Command Line

There are few things more frustrating to any computer user than files opening in an unwanted application.  Sure you can use the Open menu item in the desired application but we all just want to double-click a file and see it open in the application we expect.  I recently got to thinking about this dilemma from […]
The post Find and Change Default App for File Type from Command Line appeared first on David Walsh Blog.

Link: https://davidwalsh.name/default-app-file-type

Change System Volume from Command Line on Mac OS

Oftentimes the awesome GUI applications we love are simply gloss over a command line functionality.  While I do love a visual app, it’s always good to know how to do things from command line, if only for the sake of automation.  I’ve covered loads of command line secrets, most notably Mac Camera Access, so I […]
The post Change System Volume from Command Line on Mac OS appeared first on David Walsh Blog.

Link: https://davidwalsh.name/mac-change-volume