Welcome to the lab.

Web Excursions for December 06, 2018

[Tweet : nvALT]

Web excursions brought to you in partnership with Udemy. Learn Anything.

Wes Bos
I’d just like to point to Wes Bos and his awesome video tutorials. I’ve been through the JavaScript 30 and am currently taking his React for Beginners course and finding it a blazingly fast way to get into and understand React. Thanks Wes!
Keep a Changelog
What, why, and best practices for maintaining changelogs. It’s geared toward open source projects, but these are basic principles that all software releases should incorporate.
As a side note, I think I’ve done a great job with Marked’s release notes. Some (most) of my other projects, not so much.
Writing Workflows
An in-depth look at developing writing workflows. I’m honored to point out that my SearchLink project is heavily featured in chapter 4.
The naughty ways retailers track you online
A great report from the team at Ghostery on all of the trackers and tools that retailers are using to collect and quantify your online shopping habits, including some tips for maintaining your privacy this holiday season.
Siri may one day help you with name pronunciation
Apple has filed a patent for a name pronunciation system. I don’t see this as a “help you pronounce” tool as a potential fix for Siri’s ability to recognize and pronounce names in everyday use. I’m quite certain I’m not the only one who’s had to adopt bizarre phonetic pronunciations of friend’s names to get Siri to comply, so here’s hoping this makes it into production.

Udemy Banner

Creativity and Distraction

[Tweet : nvALT]

Some of you may recall a publication created by Aaron Mahnke (now better known for Lore) called Read & Trust. It was a zine-style collection of works by a group of trusted bloggers. I was flattered to be included in it, and wrote a few pieces for it over the course of a year.

The publication no longer exists, but I got permission from Aaron to re-publish some of my work there. I enjoyed writing this piece on finding a creative spark when faced with a blank page or a tough problem, so I thought I’d share it here. I hope you find it useful.


Creativity and Distraction

By Brett Terpstra, originally published in Read & Trust magazine.

You may or may not consider yourself creative. You might not be a designer, a painter, a philosopher… but you solve problems every day, and that takes creativity. So what do you do when you need to be creative but can’t find the spark? It’s the equivalent of staring at a blank sheet of paper, and anybody who’s ever had to write anything knows what that feels like.

Creativity is the ability to approach a problem and solve it in a new way. That problem may be a storyline you’re working on, a repair that needs to be made on your house, taking over a small country or anything in your day that gives you pause. Creativity is our means of removing roadblocks from our daily lives.

You do it all the time; coming up with answers that you didn’t have the minute before. When there’s pressure to do it, though, your conscious mind often shuts down. That’s ok, though, because what we commonly call creativity actually starts in the subconscious. It’s always working on the problem, even when you’re asleep, and you just need to back up and let the ideas surface.

There are no purely original ideas. Every creative thought since the dawn of man has been inspired by something. Often by something unrelated, but the spark of an idea never comes out of an empty mind.

When you need ideas of your own, surround yourself with everyone else’s. Don’t think about the problem, your subconscious mind will take care of that. Just absorb as many ideas as you can, whether it’s reading articles on the web or walking around town.

When I worked as a designer, it was commonly suggested that when I hit a block on a design I should go watch a movie. I think that falls short, though; a movie is too passive for me to really do anything other than watch. Personally, I need to be actively engaged in something for the ideas to really start evolving.

Surfing design blogs and sifting through other people’s work fired the most neural connections for me. As I studied a growing number of designs, the most interesting elements would stick in my mind, and I’d eventually begin unknowingly creating connections between them. Ultimately, a solution to my problem would begin to form. The answer would be original in appearance, but – as with all creations – inspired by and generated from a wealth of existing ideas. These days, as a developer, my favorite idea farm is Github, where I start randomly digging into other people’s code and letting my mind wander.

You can’t make yourself creative. You can only nurture your strengths and ideas. When the pressure is on to do something original or solve a difficult problem, walk away from it. You can study it for a while first. It’s helpful to know as many details of the problem as you can find, but step back when you get frustrated. Take a walk, surf the web or even get together with your smartest friends and just start talking. Conversations with intelligent, passionate people always spark ideas for me.

The idea of hiding away in a lakefront cabin to do some “serious thinking” strikes me as a huge mistake. I understand that everyday distractions can be a hindrance to getting work done, but – at least for me – the initial creative process just cannot take place in hiding. When you have the idea, sure, go barricade the door to the cabin and get to work. Just don’t expect isolation to solve your lack of a starting point.

Sometimes, after all of this, my active mind still hasn’t found a starting point to work with. The solution for me at that point has always been sleep. If a problem is too baffling, thinking about it non-stop never gets me anywhere. Sleeping, even just for a few hours, almost always gives my mind a chance to put the pieces together. I’ve solved many a programming problem in my sleep. I’ll admit that it takes a conscious effort to get myself to go to bed when there’s a problem looming in my mind, but I know from experience that after all my apparent options are exhausted, Morpheus is my best hope.

When the heat is on and your creativity just isn’t there, let distractions in. Find your answer by not looking for it.

Lucky Charms, a light color scheme for Sublime Text

[Tweet : nvALT]

I’ve always used dark color schemes for coding. I never use dark themes for writing, and I’m not a fan of Dark Mode in Mojave, but for some reason I’ve always gravitated to light-on-dark for coding. I decided to try a change, and I’ve been quite happy with the results.

I’m still using Sublime Text. As much as I dig many things about VSCode, I haven’t been able to dedicate myself to it and leave behind the comfortable environment I’ve built in Sublime. So this color scheme is for Sublime Text.

I also wrote this theme in the old PLIST format from TextMate which even TextMate doesn’t use anymore. Lack of necessity is the only reason I haven’t converted it to JSON, but feel free to submit a pull request.

I created Lucky Charms based on some of the ideas I loved from the original Espresso editor light theme. Part of my draw to dark themes is the contrast it offers for highlighted syntax. Lucky Charms aims to close that gap for me. It uses transparency and background colors to highlight function names and property keys with blue moons, regular expressions with yellow stars, and strings with green clovers (colors I mean, no emoji involved).

Without further ado, a screenshot:

Grab the theme on GitHub. I haven’t added it to Package Control, but you can just copy the tmTheme file into ~/Library/Application Support/Sublime Text 3/Packages/User/ and open the Sublime Text->Preferences->Color Scheme… menu to use it.

I’ve really only tested it with shell, css, javascript, and ruby files at this point. If you like it and want to expand it for any scopes, please feel free to submit updates (pull requests preferred)!

As always, I’m open to all criticism, but if your complaints are about light themes in general, consider > /dev/null.

Shell Tricks: instant wildcard directory search

[Tweet : nvALT]

Here’s a handy trick I use at the command line to quickly find filenames matching simple wildcard patterns in nested folders. It’s called lsgrep because that’s essentially what it does: grep a list of filenames and return matches.

Dependencies

This function uses The Silver Searcher (ag), which can be installed via Homebrew (brew install the_silver_searcher). It could easily be modified to work with ack or other grep replacement (or grep itself, with the right options).

Installation

Copy the function below into your ~/.bash_profile (or wherever you source functions from at login). Source the file to test it out (e.g. source ~/.bash_profile).

By default it recurses 3 levels deep into folders. You can modify this in the last line by changing the number after the --depth flag.

# Convert simplified wildcard pattern to regex and grep a file listing using
# Silver Searcher (`brew install the_silver_searcher`)
lsgrep ()
{
    NEEDLE="$(echo $@|sed -E 's/\.([a-z0-9]+)$/\\.\1/'|sed -E 's/\?/./'| sed -E 's/[ *]/.*?/g')";
    ag --depth 3 -S -g "$NEEDLE" 2> /dev/null
}

Wildcards

You’ll note that when it creates the $NEEDLE search term, it substitutes basic “*” and “?” wildcards for actual regular expressions. It also escapes “.” to search for a literal period. Spaces are converted to “.*” searches, meaning any number of characters can exist between the arguments. Thus:

$ lsgrep d?rty
source/_posts/2015-09-22-quick-and-dirty-json-validation-in-cocoa.md

$ lsgrep d rty # (or lsgrep d*rty)
node_modules/coffeelint/3rd_party_rules.md
post_backup/2010-11-01-a-little-rock-and-roll-inconsequential-martyr.md
source/_manually_copied/share/InconsequentialMartyr.mp3
source/_manually_copied/share/InconsequentialMartyr.ogg
source/_posts/2010-11-01-a-little-rock-and-roll-inconsequential-martyr.md
source/_posts/2015-03-05-marked-2-dot-4-11-party-like-its-9-dollars-dot-99.md
source/_posts/2015-09-22-quick-and-dirty-json-validation-in-cocoa.md
source/_posts/2016-11-03-great-games-just-in-time-for-the-holidays-sketchparty-tv-and-truth-truth-lie.md

In the first example you can see that the “?” wildcard only allowed one random character between “d” and “rty”, so the file containing “dirty” was returned. In the second example the search was converted to “d.*rty”, so any file with containing a “d” and then an “rty” at any point after is matched.

Limit By Filetype

The literal period substitution allows you to add an extension at the end of the query to limit the filetype.

$ lsgrep d*rty .md
node_modules/coffeelint/3rd_party_rules.md
post_backup/2010-11-01-a-little-rock-and-roll-inconsequential-martyr.md
source/_posts/2010-11-01-a-little-rock-and-roll-inconsequential-martyr.md
source/_posts/2015-03-05-marked-2-dot-4-11-party-like-its-9-dollars-dot-99.md
source/_posts/2015-09-22-quick-and-dirty-json-validation-in-cocoa.md
source/_posts/2016-11-03-great-games-just-in-time-for-the-holidays-sketchparty-tv-and-truth-truth-lie.md

It’s a great shortcut to find files you know the name of, and in iTerm you can then just Command-Click a result to open it in the appropriate editor. You can also use it in another command like cat $(lsgrep d?rty). I hope you find it as useful as I do!

Web Excursions for November 06, 2018

[Tweet : nvALT]

Web excursions brought to you in partnership with MindMeister, the best collaborative mind mapping software out there.

Keeping Chrome Light on Its Feet
I’ve mentioned Workona before, and it remains my favorite tab/window/workspace management solution for Chrome. The developers recently solved the problem of potentially increased CPU usage when you had too many tabs/workspaces open, and now it’s not only the most convenient tab manager, it’s the fastest way to work with a TON of windows and tabs.
Here’s How Much Bots Drive Conversation During News Events

About 60 percent of Twitter activity related to the caravan late last week was driven by bots, according to a new tool aimed at news organizations.

sharkdp/fd: A simple, fast and user-friendly alternative to ‘find’
A handy (and simpler) alternative to ‘find’ in your Terminal.
ncdu - NCurses Disk Usage
A really nice NCurses-based disk utilization CLI that gives you a navigable file tree with file sizes and paths. Drill down to find the disk hogs.
sharkdp/bat
A cat(1) clone that offers paging, colorization, and line numbering as standard options. Just alias cat=bat and go.

Check out MindMeister and start brainstorming, collaborating, and boosting productivity.

The Marked 2 NaNoShaNoWriMo Sale

[Tweet : nvALT]

It’s No-Shave November and National Novel Writing Month. I figured as long as we’re letting our body hair grow while toiling over literary masterpieces, I should probably make sure everyone has the best possible writing tools.

During November, Marked 2 will be 30% off ($9.99). No coupon needed, and the price applies to both the Mac App Store and Direct versions. Go get it while it’s hot!

Even if you’re not joining me in the Marked sale, do check out No-Shave November and help support cancer awareness and research.

Why Every Novel Writer Should Use Markdown

Whether you’re shaving or not, if you’re writing there’s good cause to get into Markdown. Here’s the number one reason: it’s just text.

You don’t have to learn a darn thing. If you’re most concerned about getting words on the page, using a text editor that relieves you of any considerations about formatting, images, and fonts means you focus on getting your ideas out.

Markdown is just plain text, you already know how to write it. You can learn more to add images, links, text emphasis, tables, etc., but for 99% of novel-writing, you don’t need those things anyway.

Marked can show you beautifully formatted versions of what you’re writing without you needing to touch a font palette at all. So pick a text editor, get Marked, and get to writing.

(Additionally, using Markdown and Marked 2 means you’re definitely not using a typewriter, so there’s zero chance for males of catching that beard you’re growing on a carriage return.)

But Is There Anything New?

The latest update (version 2.5.27) just went out. Since I last blogged about it, there have been several releases, including a plethora of improvements and fixes, so here are some highlights:

  • The URL Handler can add new Custom Styles directly from files. See StyleStealer, my recent bookmarklet for turning any web page into a Marked custom style.
  • A full set of Mojave Dark Mode improvements (including fixing the black-on-black “Report Issue” window)
  • Improvements for “Multi Column” mode (choose Multi-Column from the Style menu)
    • Multi-column theme page numbers
    • Multi-column theme document progress indicator
  • New Status bar icons
  • Offer suggestions for Use Alternate marks when highlighting (with default Plain English Campaign word list items only)
  • Highland/Fountain improvements
    • Handle Highland-specific text directives
    • Allow Highland files to be Markdown instead of Fountain
    • Option to process any document as Fountain, even without a Fountain extension
  • In-document search improvements
  • MindNode 5 integration handles both single file and package formats
  • There’s a new preference to syntax highlight only fenced code blocks which have a language specified

Fixes

  • Fixed various crashes
  • Handling of images linked to other images with inline syntax
  • Collapsing sections caused display errors with highlighted code blocks
  • Cmd-D and backtick will now both set a new bookmark at the first available bookmark index
  • IA Block syntax rendered inside fenced code blocks

If you’re not already a Marked-using Markdown lover, take advantage of the November pricing and grab your own copy of Marked 2!

The future of the TabLinks Safari Extension

[Tweet : nvALT]

A long time ago I wrote an extension for Safari called TabLinks. It simply generated Markdown lists of links to all the currently opened tabs. It’s been updated a few times over the years, but recent changes to Apple’s handling of Safari extensions has discouraged me from further updates.

I didn’t realize how many people used and relied on the extension until it was suddenly no longer available. Since the release of macOS Mojave, Apple now requires that extensions be released as apps through the Mac App Store, codesigned and approved by Apple. I could do this, but it’s a lot of extra effort and it’s a pretty simple extension for all that work.

So, what I’m proposing is moving the functionality outside of Safari. There’s already a Service in the Markdown Service Tools that grabs all of the open Safari tabs and inserts a list of them into your text editor. The only thing that TabLinks really added to that was templating, allowing the format of the list to be customizable.

If I expanded that Service to allow templating and the storing of templates in persistent preferences, I think it would cover the needs of those who used TabLinks. What I’m curious about, and putting forth as a question to be answered in the comments is: are there other aspects of TabLinks that you use and would miss? Are there additional features you’d like to add?

Let me know in the comments!

Yours in nerdery,
Brett

Web Excursions for November 01, 2018

[Tweet : nvALT]

Web excursions brought to you in partnership with Udemy. Learn Anything.

Exposing China’s Digital Dystopian Dictatorship
Another disturbing look at the surveillance state cum digital dictatorship in China.
Three Inspiring Role Models Embrace Modern Media To Close The STEM Gender Gap
The fact that interest in STEM among young girls starts waning by the age of 6 is a serious issue to me. Anything that starts turning that tide is a step we need to take.
‎Silenz on the Mac App Store
A cool little macOS utility for people who listen to music on their headphones. When an external sound passing a set threshhold occurs, it will pause your music and amplify the sound through your input device (all customizeable) basically making sure that when someone starts talking to you, you don’t have to pause your music and ask them to repeat themselves.
DesignBase
A well-curated directory of free resources for designers, including plenty of icons, stock photos, and UI mockup kits for Sketch, Photoshop, and more.
Gladys Project
I’ve been feeling guilty about how much of my privacy I think I’ve given up by having Amazon echos around my house, so this Raspberry Pi-based, open-source home assistant has piqued my interest.

Udemy Banner