RSS Feed Subscribe to RSS Feed

 

Sublime notes

The following are some notes & examples of using Sublime Text for quick text editing, typically using regular expressions.

(more…)

Tags: , ,

Dev Environment Setup

This post covers some of the basic steps I need to do each time to setup my dev environment on a new mac. I use this post in conjunction with the mac tools post.

(more…)

Tags: , , , , ,

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 (in the most recent version, it seems to be Smart Item -> Clipboard -> Plain 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 (and directories). 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 [options] pattern [files]

Example:

grep -rl --include=*.java "MySearchString" .

(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: , , ,

Mylyn

I’ve started using Mylyn. It is a “task-focused interface for Eclipse that reduces information overload and makes multi-tasking easy”. Its objective is to improve productivity by reducing searching, scrolling, and navigation.

What does that mean? Basically, it allows you to access your bug tracker from inside Eclipse and then for each task/bug you are working on, it remembers what files you have been using most. The result is that when you switch back to a task you were working on before, the important and most relevant files you were using will be reopened and so at any given time, the files you need are close to hand.

The ‘tasks’, in my case, are defects/enhancements assigned to me in Trac (or specifically DevJaVu), but it has integration with Bugzilla, JIRA and others.

It’s not exactly ground breaking or revolutionary, but it is definitely useful (although the integration/synchronisation with Trac does seem to be a bit flaky, but maybe that is an issue with DevJaVu).
Next up, I would like to start making more use of the change set support.

Tags: , , ,

NetBeans IDE

I have been playing around with the latest NetBeans IDE (v6.1) recently, mostly as part of some JEE and  Glassfish research I’ve been doing. I am a long time Eclipse user (even back to its predecessor, VisualAge for Java), but I have been pleasantly surprised by NetBeans. It’s UI is definitely a litlle clunkier than Eclipse, but it is fairly intuitive and easy to use and it also seems to useful GUI builder tool that I would like to experiment with more.

See some reviews here and here.

Overall, interesting and I’d like to use it some more, but I still have no plans to stop using Eclipse as my main IDE.

Tags: , , ,