Welcome to the lab.

Your teenage rock band

[Tweet : ADN : nvALT]

You’re a high schooler. You love music. You want to play music. Not marching band music, and orchestra isn’t cutting it for you. You want your own band.

You’d find 2/3 or 3/4 of a core band among your close friends. Then you launch the search for the final piece, and maybe some extra pieces. It’s going to be a rock band, but you have a friend who’s a really, really good fiddler. You can make that work. It seemed like a lead singer and a drummer were going to be the hardest to find. Most kids who were into starting a band had taken guitar lessons, and some had chosen bass. Those two were easy to nail down. Teen self-esteem made lead singers tougher to find, and good drummers were in such high demand that finding an available one was a challenge. A singer doesn’t need much experience, and a guitar player can usually pick up bass reasonably well, but you don’t just pick up drums. But you found them all, eventually.

Then you had to find a rehearsal space. You couldn’t afford to rent a space, so you find garages and basements at whoever’s house has a parent or parents that worked late (or happen to be wonderfully permissive). Your equipment sucks enough to begin with, but the acoustics in a garage made life hell. The louder you played, the worse it sounded. The acoustics in a basement were different, but not much better. You can hear your bandmates now, though.

You rehearse and rehearse. After some covers, you start writing original songs. Your style starts to form. Someone in the band eventually hears something worth keeping. They convince you to play live.

Then you talk some friends into letting you play their party. It doesn’t go well. Maybe it went badly enough that someone in the band gives up and you start the search again. Maybe, though, you’d found a group of kids who were willing to soldier on.

You keep at it. You bond through the humiliation of gigs that probably weren’t as bad as you thought. Soon you get more cohesive. You get better.

Then it’s time to scrap together a demo tape. Someone has a small 4-track cassette recorder, or the local pawn shop has one you can pick up on a McDonald’s wage. You can’t afford good mics, though, so even if the noise bed on that 4-track weren’t insane, the combination of your basement-cum-studio and lack of anything but that blues mic your singer is in love with makes for an almost-indistinguishable, muddy mess. But you can make it out. You can live with it.

You make the rounds to the local all-ages venues and drop off the demo with the booking agents. You only had 10 copies you made on your stereo, all worse than the original thanks to sound degradation on magnetic tape copies, but one of those 10 calls you back. You got a gig playing something more than a basement when your friends’ parents were out of town.

You show up. They have house amps and a soundboard for you. They have monitors. You hear yourself pretty close to the way everyone else does for the first time. It’s exhilarating. You play. People dance. People you’ve never met talk to you after the show. You feel like keeping this going.

That good show gets you other gigs. Playing clubs makes you feel like you’ve made it. Seeing the same faces start showing up regularly boosts your ego. You have fans. It’s time for a record.

Between the three or four of you, you can come up with about $600. That’s enough for an hour at that studio at that one club. You can play you’re entire catalog of ten original songs in an hour, you’re sure of it.

But your drummer keeps demanding retakes, and your singer keeps telling the guitarist that he or she is off tempo. Your guitarist keeps telling your singer that he or she obviously can’t hear themselves in the cans. Egos clash. Tempers flare. You finish three songs before the hour is up, and the ride home is awkward and silent.

Then you get the mixdown. It’s the best you’ve ever heard yourselves sound. Everyone is critical of their own performance, of course, but there are no showstoppers. You decide to sell it as an EP. Maybe CD burners became a thing later in high school. An affordable thing. You make pristine copies and put them on the merch table. You make enough money on sales over the next few months to cover the original recording costs.

Between the door and the merch, you’re making enough to pay for gas to get to other towns. You can’t tour, because at least half of you are still in school, but you can play Friday nights as an opener at the club in the bigger town an hour away. It’s a cold drive because your Plymouth Rampage has a weak heater, and at least one band member has to ride in the back with the drum kit and amps. Fortunately, every band always has one good sport.

You start dreaming about rock stardom. Making it big. This is going to be a career. Then things plateau. You’re one of a dozen bands in the area in the same situation. Maybe you make it to headlining the shows. Maybe you don’t. It doesn’t matter because none of you are getting record contracts. You just can’t get the kind of exposure you’d need for that.

Then graduation comes. The diaspora. It’s “adios, I hope you find a new band in college town.” Sure, one or two of your crew probably aren’t headed to college, but at least one of them—probably the one with the 4-track and the mics—is. If the band goes on, it won’t be the same band.

Soon after, the Digital Audio Workstation becomes something the average high schoolers can get their hands on. You imagine what it would have been like to have your own studio back then. A little carpet on the walls in the basement, a couple of decent mics… and to have all the time in the world to make a perfect recording. A digital recording. And what if, you wonder, there were some technology that let you get that recording into not just the hands of a label, but to the whole world? What if you could do it for free? What if there were something that could level the playing field a bit, letting the listeners decide who got heard instead of the labels? It would be a different world.

Hey, look at that, it’s a different world.

Titler 1.1.0

[Tweet : ADN : nvALT]

I’ve been tweaking the Titler Service I published last week a bit over the last few days. It’s now an official “project” with its own page. I wanted to push this version out before I lose any more time to it, but if you run into any problems, be sure to drop me a line.

Titler no longer has any dependencies. I replaced nokogiri with a simple regex. The original goal for this little tool had need of more complex parsing, but pulling a title tag out just doesn’t. I also replaced the standard network methods with system curl calls, which means no more hassle dealing with SSL (https) urls.

The new features include:

  • Option to remove SEO tags (site title, site tagline etc.) from titles
    • To use this, add clean_seo_titles: true to your ~/.titler config file
  • If a title is truncated, you can optionally include the original (full) title in a title attribute.
    • add full_title_as_title: true to ~/.titler
  • When truncating titles, Titler will now ensure that any open punctuation pairs are closed at the end
  • HTML entity cleanup
  • UTF-8 support
  • Improved error handling
  • A bunch of more trivial improvements

You can download directly below, and see the Titler project page for more info.

Titler Service v1.1.0

An OS X System Service to add titles and affiliate tokens to urls (Markdown format) in selected text

Updated Wed Feb 25 2015.

More info…

Sketch cheatsheet for Cheaters

[Tweet : ADN : nvALT]

If you use Cheaters, you may also be the type of person who uses Sketch. If so, you’ll appreciate the addition of a cheatsheet for Sketch Shortcuts, based on the tables provided at Sketch Shortcuts.

To add it, just put the sketch.md file into your cheatsheets directory (or just git pull the latest update if you installed via Git), and add it to your index.html:

<ul id="nav">
	[...]
	<li><a href="cheatsheets/sketch.md">Sketch</a></li>
</ul>

If you’re new to Cheaters, check out the documentation and download it from the project page. I should also note that there’s a new Xcode cheatsheet which was submitted by Thomas Bennett. If you create any custom sheets for common apps, be sure to let me know!

For web nerds: fixed-position element scrolling in WebKit

Since you use Sketch and Cheaters, and you made it this far in the post, you probably work with CSS, too. If that’s not the case, I can only imagine what possessed you to read this far. Either way…

I also fixed a CSS issue in the Cheaters window. This should actually be a separate post for the sake of search engines because it’s a fix I think will be handy to others, but I wouldn’t want any extra traffic…

In the latest versions of WebKit, position: fixed elements occasionally wiggle all over the page during scrolling. I ran into this with Marked, on a couple of web pages, and just noticed it in Cheaters as well. Fortunately, I had figured out the issue a while ago.

As far as I can tell, it happens when a CSS rule triggers the WebKit animation engine (even for 2d transforms). If it doesn’t break anything else on your page, you can fix it with:

body {
  -webkit-transform-origin-y: 0;
  -webkit-perspective: 1000;
}

You should still be able to apply custom transform-origin and perspective properties to more specific elements within the DOM, but having the outer element reset takes care of the issue. I hope that’s useful to somebody…

Web Excursions for February 21, 2015

[Tweet : ADN : nvALT]

Do Button, Do Camera, and Do Note
Three iOS/Android apps from IFTTT to give you one-tap access to a variety of actions. The “Do Button” app can connect to any of your IFTTT recipes, and the camera and notes app provide additional features specific to their respective functions. See links here for Android versions.
Beam: Smart projector that fits into any light socket
See the Kickstarter page for details. While the 100 Lumens on the 854x480 projector aren’t going to make a home theater for you, the automation capabilities and potential uses make it fascinating. To me anyway. Because I’m a dreamer.
Five minutes to Markdown mastery
If you haven’t figured out Markdown yet, here’s a concise 5-minute guide from Remarq to help out. A great resource, thanks to all the Twitter folk who pointed it out! (When you’re ready for a more in-depth look, check out my video tutorial. And Marked, of course.)
Sketch Toolbox - A super simple plugin manager for Sketch
A plugin manager with search and update capabilities for Sketch plugins. I’m actually even happier about this than I was about Alcatraz for Xcode (which is also awesome).
SketchTool
A CLI from the makers of Sketch that enables you include export functions in your build scripts, among other tricks.

Seems like it might be time for a pledge drive…

[Tweet : ADN : nvALT]

I know I’ve been a bit slower on posting the madness from the lab lately. I’ve been working on more and more larger projects that have two results on my blogging: I don’t have as much time to document smaller tricks and tips to an extent where I’m comfortable posting, and I’m not finishing as many shorter-term projects to woo you with. I think the end results of the things I’m working on will be of interest to many of you, but they’re taking some time1.

It’s been a while since I mentioned ways you can support the blog and the effort that I put into the many projects that I give away for free, mostly because I feel guilty asking for such support when I’m offering less content in the short term. However, a recent surgery and some hefty auto repair bills2 have strained my wallet, and combined with the fact that the projects I’m working on won’t pay off until they’re finished, I think it’s worth a shot.

I’m not appealing to your sympathy, though. I’d prefer to be supported out of appreciation for what I share, not any kind of guilt. If you do appreciate the tools and tips I share here, there are a few things you can do to help.

  1. You can pledge a small monthly donation through Memberful (or PayPal if you prefer)
  2. You can make a one-time donation of any amount you choose
  3. If you’re a Markdown user, purchasing a copy of Marked 2 would certainly be mutually beneficial

My current “indie” life is split between commercial projects and continuing to build tools and workflows to share publicly. Your support makes the latter possible (and your love of Markdown makes the former feasible). Thanks to everyone who’s currently subscribed or who have donated, you have no idea how much I appreciate it.

  1. I used to complain if I had to work more than 8 or 9 hours in a day at corporate jobs, or was ever asked to work a weekend. My current boss (this prick) has me working up to 18 hours a day and somehow I’m putting up with it.

  2. I like Nissans, but that Murano is slowly killing us. No, not slowly. Quickly. My Audi repair costs pale in comparison.

Shell trick: printf rules

[Tweet : ADN : nvALT]

This post is about a simple trick for printing a horizontal rule in the Terminal, but I would like to start by saying that the headline is not entirely an attempt at humor. I spent a long time working with the limitations of echo, with its -e annoyances and -n inconsistencies between shells. Then I started using printf more, and it’s made string formatting and terminal output so much simpler. Check out the man page (and some more info on format strings)if you’re not already familiar with it.

As a quick example, my most frequent use of printf is outputting shell arrays. What would normally require a loop with echo is a single line with printf:

# Output a Markdown bulleted list of all applescript files
printf '* %s\n' *.applescript

# or
declare -a arrayvars=( one two three )
printf '* %s\n' ${arrayvars[@]}

The rule function

One feature I just recently learned about is variable substitution in format strings. A token in the format string can use an asterisk (*) to accept a variable from the input as a number for the width. This is what the rule function uses:

## Print a horizontal rule
rule () {
	printf -v _hr "%*s" $(tput cols) && echo ${_hr// /${1--}}
}

With that function loaded in Bash, you can run rule to output a horizontal string of hyphens the full width of the terminal:

It’s a handy snippet for using inside of other functions and scripts to separate output or call attention to an output section.

Explanation

A quick breakdown:

  • printf -v _hr assigns the result of the string interpolation to the variable “_hr”
  • %*s waits for numeric input to define the width of the string, which in this case will be output as that number of spaces
  • $(tput cols) is replaced with the number of columns in the current terminal as reported by tputs (passed to the %*s)
  • If the command is successful (&&), the variable is output with Bash substitution (${var//s/r}) to replace the spaces with a -

The character used for the horizontal rule is pulled from the first argument ($1), and defaults to “-“ if the argument is null (${1--}). It only accepts a single character if you want a single line. If you want a double line, use two characters (==), and so on. You can use any character you want, including extended ascii or unicode with some echo -e work:

$ rule `echo -e "\\xE2\\x98\\xA0"`
☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠

Variation with message

I also whipped up a version that allows me to add a message to the ruler, which is working well for output with multiple sections:

## Print horizontal ruler with message
rulem ()  {
	if [ $# -eq 0 ]; then
		echo "Usage: rulem MESSAGE [RULE_CHARACTER]"
		return 1
	fi
	# Fill line with ruler character ($2, default "-"), reset cursor, move 2 cols right, print message
	printf -v _hr "%*s" $(tput cols) && echo -en ${_hr// /${2--}} && echo -e "\r\033[2C$1"
}

Now in another script I can use:

$ rulem "[ How about that? ]"
--[ How about that? ]--------------------------------------

The message is the first argument, the optional second argument is the character to use for the rule.

Bonus trick

Lastly, here’s a quick printf alias to output right-aligned text using the same trick as rule:

alias right="printf '%*s' $(tput cols)"

Now the argument passed will be prefixed with whitespace padding to fit the full number of columns in the terminal.

Go forth and script.

Titler: instantly add page titles to URLS in your text

[Tweet : ADN : nvALT]

Guess what? This is the 100th project (see?) I’ve made available for download on this blog. I don’t know what that means in the grand scheme of things, but I feel like I should celebrate.

I’ve been making a lot of new tools lately, but I’ve been short on free time to polish and document them for sharing. I have a growing list of tools and projects that I’m hoping to get around to posting soon.

Oh look, here’s one now.

This is a System Service called Titler. It does what it says on the label: finds URLs in selected text and adds titles to them based on the page title. I specifically needed this for podcast show notes as I often just paste a url into my notes when I don’t have time to do much else. This Service lets me take a pile of such links and turn them into Markdown links with their page title as the text. It also adds Amazon and iTunes affiliate tokens, cleans out referrer junk, and has the ability to neatly truncate titles at word breaks based on a maximum length setting.

Download below, unzip, and double click the included Services (.workflow extension) to install.

Titler does require a tiny bit of setup1. You need to have the nokogiri gem in your system Ruby install. That’s just a matter of running sudo gem install nokogiri in Terminal. If you use a Ruby version manager, make sure you switch to the system Ruby before installing the gem.

The first time it runs, it will create a .titler file in your home directory. Edit this file to change the default behavior. Its format is identical to SearchLink, so if you use SearchLink, you can just copy the iTunes and Amazon settings over. If you don’t want affiliate links, just delete the contents of the keys for them. The settings are all documented in the config file.

Once you have those two steps done, you should be able to just select text and right click, choose a Titler service from the menu, and get your titles inserted in place.

There are 3 flavors. First, the regular Titler service. It finds all urls in the text. If they’re already inline Markdown links, it will replace the text in square brackets with the title, and the url in parenthesis with the cleaned up, affiliated url. If the link is part of a reference link, it leaves the id in square brackets alone, updates the URL, and appends the title to the end in quotes.

The second one, Extract Links, will gather all the URLS in your selection and output them as a bulleted list with titles in inline Markdown format. URLs are affiliated and cleaned. Your selection is left alone and the results are put on your clipboard. It will notify you (on Yosemite) when it’s finished.

The third flavor, Affiliatize, will skip finding titles and just replace any iTunes or Amazon links it finds with versions containing your affiliate tokens. All of the “affiliatization” removes existing affilate tokens as part of the process, unless you have no affiliate tokens configured, in which case it will skip the process entirely.

Titler Service v1.1.0

An OS X System Service to add titles and affiliate tokens to urls (Markdown format) in selected text

Updated Wed Feb 25 2015.

More info…

  1. “Tiny” if all goes well. Installing gems can lead to a bad couple of hours if you run into trouble and you don’t know what you’re doing and Google has no freaking clue. Welcome to the rabbit hole.

The details count with Tally 2

[Tweet : ADN : nvALT]

I’ve written about Tally from Agile Tortoise before, expressing my affection for its intuitive interface and utility. Tally 2 is out today, looking great and taking advantage of new iOS 8 features.

Tally is simple, and infinitely useful if you — like me — have trouble remembering a number when there’s any distractions around you. You just launch the app on your iPhone or iPad and start tapping to count anything you need to keep track of. The entire screen is the button, so you don’t even need to be looking at your phone. You can swipe down to decrement the count. That’s what it does.

For such a simple app, though, there are some great features in the details.

You can have as many “tallies” running as you need (an in-app purchase unlocks unlimited counters), and each tally has settings for the direction to count on tap (increment or decrement) and the number of units to count by. The totals are persistent, and you can switch between tallies as needed by swiping to the right. You can even count right in the list view. It also handles repeating tasks well with a quick reset to a defined starting value.

You can turn on audio confirmation for an audible confirmation of a tap, which is nice if you’re focusing on what you’re counting and not on your phone.

There’s sharing support, and in-app purchases for a dark theme and the aforementioned unlimited tallies. The coolest part, though, is the integration with the Today view on iOS 8 for ubiquitous tracking of your tallies. Not having to switch to the app to add a count to something makes it frictionless.

There are also a couple of new actions for the URL scheme available for integration with other tools. The tally2://x-callback-url/increment?title=Tally%20Name handler is especially intriguing, although I haven’t built it into anything… yet.

Check out Tally 2 on the App Store. It’s free to download, and $1.99 US will get you all the counting and totaling you could ever desire (plus the night mode).