RSS Feed Subscribe to RSS Feed

 

Using Butler shortcuts to enter commonly used text

Is there a piece of text that you find yourself typing again and again? Want a keyboard shortcut to enter it? For example, pressing Alt-E to enter your email address anywhere.

The solution I use is Butler. It is an extremely versatile tool.

  • With Butler running, go to Configuration
  • Right click on Hidden Items
  • Smart Item -> Text
  • Under Triggers, specify your ‘Hot Key’ keyboard shortcut
  • Under Text, specify your frequently entered text e.g. email address

Done! The next time you press Alt-E anywhere, your email address will show up.

Notes:

  • You are probably wise to choose a more obscure shortcut the Alt-E to avoid clashes with other apps, but the principle remains.
  • I use LastPass to automate filling in entire forms (name, address, email), but the approach I describe here can be used anywhere (in a document, IM window, whatever).

 

Tags: , , ,

alternative to tail -f that allows scrolling: less +F

You can use less +F to start less in its “forward forever” mode. In this mode, less will behave like tail -f, ignoring the ends of files and providing a steady stream of text.

When you want to scroll, press Ctrl-c. To re-enter forward forever mode, press F.

From http://unix.stackexchange.com/questions/81628/is-there-an-alternative-to-tail-f-that-has-convenient-scrolling

Tags: , , ,

sed

sed (stream editor) is an simple but incredibly versatile command line tool that parses and transforms text. It is line-oriented in that it reads the text line by line, transforms it, and outputs the result.

For example, this sed command would replace all occurrences of the text “white” with “black”:

sed s/white/black/g

sed reads text on a line by line basis and performs an operation on it, usually extracting or replacing text snippets. In this case, the s prefix means substitute, and the g suffix means global. Other example usages include:

(more…)

Tags: , , ,

find

“find” is a unix command-line tool for locating files. The results can be displayed, passed to another command (e.g. grep, ls etc, see more below), or the find command has its own limited set of actions that can be performed too, such as delete.

Find allows you to specify all manner of search criteria such as name, location, size, permissions, modify date etc. Using regex expressions with those criteria makes it more flexible still.

See the full find manual here.

(more…)

Tags: , , , ,

awk

I think of awk as a tool for searching, manipulating and reporting on text files, but it is in fact an entire programming language. Its basic function is to search files for lines that contain certain patterns, and perform specified actions on that line.

The name awk comes simply from the initials of its designers Aho, Weinberger and Kernighan.

The basic format of an awk command is:

awk pattern { action } file

Every line in ‘file’ matching the ‘pattern’ will have the ‘action’ performed.  Either the pattern or action are optional, but not both.
No pattern means every line is actioned.
No action defaults to print.

(more…)

Tags: , , , ,

grep

“grep” is a unix command line tool to search a file (or files) for lines containing a match to the given pattern (often a regular expression). Its name comes from the ed command g/re/p for globally search a regular expression and print (1). See the grep manual.

The basic syntax is:

grep [option(s)] pattern [file(s)]

Options can be omitted and ‘file’ will default to standard input if omitted.

(more…)

Tags: , , ,

Live Templates in IntelliJ

As described here, IntelliJ’s live templates let you easily insert predefined code fragments into your source code.
I have posted some of my most used templates below, a link to my complete list of template files on GitHub (as a reference for myself when I setup new IntelliJ environments) and the steps I took to add the IntelliJ settings file to GitHub.
(more…)

Tags: , , , , , ,

Invaluable Mac tools

After setting up a couple of macbooks recently, there are a few tools that I just need to install before I can feel at home (although not all are Mac specific).

(more…)

Tags: , , , ,

OSCON Day2: Scala

I attended the Scala Summit on day 2 at OSCON.

As well as the Scala introduction classes, there were interesting talks on Akka, Simple Build Tool and Specs….

Read more

Tags: , , , ,

OSCON Day1: The Productive Programmer

I spent the afternoon of day 1 at OSCON listen to Neal Ford give his “The Productive Programmer” talk and I have to say I loved it. I have heard Neal talk before and he is an excellent speaker: clear, funny, interesting and knowledgeable.

The talk was in 2 parts: Mechanics and Practice.
Below are my notes from the first part of the talk (see here for part2), but you can also get the original slides form here. The talk is based on his book of the same name, The Productive Programmer. Which is similar in theme but not to be confused with the “The Pragmatic Programmer” book.

Read more

Tags: , , ,