File Extension Change Shortcut
Changing the extension of a file seems like something you would do often enough to know how to do it from command line. One annoying part of moving a file is repeating the file name a second time when all I want to do is change the extension. A minor annoyance but an annoyance nonetheless.
I recently found that you can quickly change a file's extension with this handy shortcut:
# mv filename.{old,new}
mv code.{txt,js}
The braced syntax provides a way to quickly swap out the file extension without needing to repeat the file name. Sweet!
I love almost every part of being a tech blogger: learning, preaching, bantering, researching. The one part about blogging that I absolutely loathe: dealing with SPAM comments. For the past two years, my blog has registered 8,000+ SPAM comments per day. PER DAY. Bloating my database...
One of my favorite social APIs was the Open Graph API adopted by Facebook. Adding just a few META tags to each page allowed links to my article to be styled and presented the way I wanted them to, giving me a bit of control...
A while back I shared a clever technique for creating triangles with only CSS. Over the past year, I've found CSS triangles incredibly effective, especially when looking to create tooltips or design elements with a likewise pointer pattern. There's another common shape...
One of the most popular code snippets of posted on my blog has been the scrolling "Go To Top" link snippet. The premise of the snippet is simple: once the user scrolls an element (usually the BODY element) past a given threshold, a "Go...
This does not only work for file extensions. You can generally use the curly braces syntax to “generate” multiple words/arguments for a bash command: http://www.gnu.org/software/bash/manual/bashref.html#Brace-Expansion