Tag Archives: snippets

JavaScript Bookmarklet: Outline/Border all Elements of Site for Quick Development & Debugging

Need to outline all HTML elements on an open web page? I’m sure there has been a time when you’ve used something like this to do so:

 * { border:1px solid red; } 

Which gives you a quick visual look at all elements on the page and how they align. It’s simple and by all means works just fine.

To make things even more convenient, here’s a quick and handy little JavaScript bookmarklet for you web developers to save. Full credit and thanks go to “beaver82” in the following /r/webdev/ thread. I’ve edited one of his/her original scripts to include a border instead of outline,  in case you do want to affect the box size.

Demo of the Outline Elements JavaScript Snippet

Demo of the Outline Elements JavaScript Snippet

Snippets:

The border/outline scripts are distinguished by the file names listed above.

Usage

  • Drag or save the JavaScript snippet desired (either js_border_elems.jsjs_outline_elems.js, or both) to your browsers bookmarks bar.
  • Name it something useful, such as “Outline * Elements
  • Click on the snippet to outline/border elements on the current page. Click again to remove the outlines/borders.

Enjoy! If you have any similar useful snippets, please do share them in the comments section.

Mac OS X Gestures Freeze or Stop Working? Here’s a Quick Fix.

Update: Alfred extension released for those of you who would prefer not to tinker with Terminal. See bottom of this post.

Mac OS X gestures freeze or stop working? Perhaps your hot corners or Launchpad also stopped working? I’ve also experienced this and have a quick one-line fix.

Here’s what usually happens:

  • You’ve been on your Mac for a while and suddenly gestures aren’t working for you.
  • Clicking on “Mission Control” and “Launchpad” don’t work.
  • Hot corners also may not be working during this time.

If you’ve experienced any of the issues with gestures as described above, the good news is there is a quick fix.

What’s the fix?

The fix is to restart or “kill” the dock. This isn’t as scary as it sounds. This won’t close any of your currently running apps, but the dock will disappear for a bit, restart, and then re-appear.

To do this, fire up Terminal and type the following:

killall Dock

That’s it. Your dock will restart and your gestures and hot corners should work again.

What Causes This?

I’m not sure why gestures randomly freeze or stop working. I don’t think it’s a 3rd party software conflict as I’ve had this happen while only running Safari.

I’ve seen a few forum threads from a google search with many users having the same issue, so I assume it will be fixed by Apple as they polish gestures up a bit. If you have any insight or suggestions please do leave them in the comments section.

I’m also considering making an Alfred extension for those of us who don’t always have the Terminal ready and waiting, or, for those who don’t feel comfortable with the Terminal/CLI.

Update: Alfred extension “Mac OS X Gestures Freeze Fix” has been developed and released for all of you Alfred users.

More plugins and Alfred scripts I’ve created can be found at  software.creatingdrew.com.