Blog

learnings

AppleScript to change clipboard image format

coding macos office

For the longest time, I’ve struggled to get the macOS version of Microsoft Office (Word, PowerPoint, Excel) to paste images as PNG or JPEG, instead of the default TIFF. TIFFs make the files far larger than they need to be! I’ve resorted to macros, shell scripts, Quick Actions... all paste PNGs (lossless) into MS Office! But I just found another method with AppleScript.

Continue reading...

A few of my bookmarklets

coding javascript

I have a few Javascript bookmarklets that I thought I’d share. Bookmarklets are short snippets of JavaScript code that run in the context of the current web page in the browser. I prefer them over extensions since I can see what the code does. There are plenty on the web, here are a few of mine.

Continue reading...

Hide Firefox Toolbar and Tabs in Fullscreen

coding macos javascript

I use macOS spaces (virtual desktops) to arrange the various apps I frequently use. I have one space setup with two Firefox windows, in fullscreen Split View mode. But by default, Firefox windows are not really “full screen” for me, in that the tabs, toolbar and bookmarks bar will still be displayed. Here is my workaround to force the browser to full screen.

Continue reading...

CSS tips to avoid Javascript

coding css

Recently I’ve been building a few web sites without JavaScript where possible, relying instead on modern browser support for CSS.

Here are some things I’ve figured out, including toggling the NavBar burger dropdown, smooth scrolling, showing and hiding modal dialogs with transitions!

Continue reading...

Single Page Bulma template with Smooth Scroll and Scroll Spy JavaScript

coding javascript css

I was building a single page website using Bulma, and I wanted to achieve effects similar to what I was familiar with using Bootstrap’s Creative one page theme. As you know, Bulma (mostly) does not provide any JavaScript code, so I had to code the Smooth Scrolling and Scroll Spy features I missed. I intentionally avoided jQuery! So I present my solution using plain-old JavaScript.

Continue reading...

Word Macro to paste MS Office Drawing / TIFF image as PNG

coding office

I really don’t know how to explain today’s post. In short: I want to copy drawings and images out of Microsoft Office in PNG format. On macOS, copy-and-paste seems to prefer the TIFF format, resulting in large Office files. I’d rather the images be converted to PNG, preserving transparency but providing high compression. However, this is more complicated than it seems, because of limitations in Office and PowerPoint in particular...

Continue reading...

Prototyping with a Node-RED container

coding container cloud

If the preceding posts on Node.js and MongoDB have been too complex for you, let me introduce you to a simpler drag-and-drop “flow-editor,” Node-RED.. It was developed and open-sourced by IBM, and is now hosted by the OpenJS Foundation (the same foundation that hosts projects like jQuery, and Dojo). I’ve used Node-RED for quick prototypes and demos, as it’s easy to explain each step of the flow. It saves a lot of coding effort and reduces errors buy providing built-in and pre-built third-party “nodes”.

Continue reading...