Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Handy Regexes for Search and Replace.


Sublime Text - my favorite editor - will let you use a regular expression (regex) in its search and replace functionality. Here are some handy regexes that I've used in the past:

Any anchors
Any dollar value
All HTML comments and their contents
Either "alpha" or "beta"
Any blank lines
Any pair of "s not preceeded by ="
Sass mixins
@mixin .* \{
Sass extends

Inkscape - Using Path > Difference With Text.


It turns out that Inkscape's error messages will appear in the status bar at the bottom of the application.

Part of getting my Glowforge laser cutter has been learning to use a new piece of software, Inkscape. I was having problems using Inkscape's "Path > Difference" option to combine (well, cut out) shapes and text elements. Here's what I had to do to get the elements merged:

  1. Optional: Disable any stroke styles on both objects. Use fills instead.
  2. Optional: Make sure the first element - the non-text - is a path. Select it and choose "Path > Object to Path".
  3. Turn the text into a path. Select it and choose "Path > Object to Path".
  4. Ungroup that new path. Right click it and choose "Ungroup".
  5. Bring the "top" element to the top layer (Home). This is what will be removed from the other element.
  6. Position / align the elements as desired.
  7. Select both of the elements.
  8. Choose "Path > Difference".

Global Diversity CFP Day Q&A.


Last week was Global Diversity CFP Day and we held the Seattle workshop that I'd been organizing for a few months. Global Diversity CFP Day was started by Peter Aitken, who ran a similar event to improve the diversity of submissions for his event ScotlandJS. At the event, a number of locations world-wide held workshops where people who are under-represented at technology conferences could learn about submitting talks to conferences from experienced speakers and event organizers. The attendees asked some really good questions, so I figured I'd answer them here for posterity. I hope readers will forgive me for including one "Socratic method" question at the end.

Games I've Beat.


Gender-based marketing is lazy and video game marketing has been lying to you. Here is a list of video games that I have beat. Where "beat" means variously beat the final boss, won all races or levels, or completed the story, as appropriate for the genre.

Keyboard Shortcuts for Web Dev Tools Inspector and Console.


Sometimes, right clicking on something in a browser and picking "Inspect" from the context menu just isn't fast enough for me. I wanted to find a way to quickly open the Inspector and Console tabs in a browser's web developer tools, so naturally I turned to keyboard shortcuts. I've compiled a reference of the commands for Firefox and Chrome here.


Even better, the Web Dev tools will open up - with the last active tab - when you hit your F12 key. (In OSX, use fn F12 if you haven't enabled the "Use all F1, F2, etc keys as standard function keys" Keyboard Preference.)


The DL Element.


At a conference earlier this year, I was asked what my favorite HTML element was. In fact, I do have one: the Definition List, along with its children Definition Term and Definition Description. The definition list is great because it provides an inherent semantic relationship between two elements - the term and the one or more descriptions. I feel like these elements are under-used; especially considering that they've been around since HTML 4.01.

I was going to invent a clever example to demonstrate the definition list, but I don't think I can do any better than the one provided by the Mozilla Developer Network:

A free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers.
The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long).

Here is the source code for that:

  <dd>A free, open source, cross-platform, graphical web browser developed by the Mozilla Corporation and hundreds of volunteers.</dd>
  <dd>The Red Panda also known as the Lesser Panda, Wah, Bear Cat or Firefox, is a mostly herbivorous mammal, slightly larger than a domestic cat (60 cm long). </dd>

This shows one term (Firefox) along with two definitions of that term. Because it's a list, you can add as many groups of terms and definitions as needed for your content.

Virtual Reality.


An attendee tests VR goggles at JSConf Last Call Folks love to post pictures of people using virtual reality (VR) googles, because everyone just looks so darn goofy with the headset on. But virtual reality really does have legs. In the past couple years, I've seen some truly convincing VR demos, and run across amazing uses for VR. (Photo by Matthew Bergman from JSConf Last Call; CC BY-NC-ND 2.0.)

This year, 3 friends and I played a demo of Marvel Powers United VR on 4 fully loaded Oculus setups with motion sensitive headsets and hand-held controllers. A single set of this gear costs multiple hundreds of dollars. When my system booted up, I was The Hulk - I was taller than everyone, my strides consumed feet like they were inches, and I could grab puny humans by their baseball-size skulls. It was unbelievably immersive; my brain easily believed in this new reality. I only experienced a little motion sickness; see (this for more on gender and VR motion sickness).

With any one of a number of electronic headsets and their companion apps, you can record and view panoramic or even 720° photos (some with even ambient sound). You can then view these high-resolution photos on the headset where moving your head moves the view of the photo. I've had demos of this too, and they're also very immersive. Can you imagine immersing your family in your vacation photos like this? Or remember that folks with disabilities are often technology's earliest adopters - virtual environments like this would be huge for those with severe anxiety or people who have trouble traveling.

Think about watching your favorite sports team; with 3D sound and picture captured right on the sidelines? Beyond games and entertainment, the universal on-line educational system of "Ready Player One" seems tantalizingly close. If you ever get a chance to try out some of this technology, I highly recommend checking it out.

There are more utilitarian ways to utilize VR. Google offers Cardboard, a $15 set of "glasses" that you insert your smartphone into. As just one example of apps for Cardboard, here is one which simulates a conference stage, so that you can practice your public speaking.

If you're a developer, this is a great time to start working with VR technologies. A great place to start is Shagufta Gurmukhdas's SeattleJS Conf 2017 talk about VR and Mozilla's A-Frame.