global

How to populate sample data when a Play Framework application starts up

If you ever need an example of how to do something when a Play Framework application starts up, check out the Zentasks application in the Play distribution samples directory. You'll find the following code in the Global.scala file in the app subdirectory of the project. It shows how to use the onStart method of the Global object to populate some sample data when the Play Framework app starts up.

Here's the source code for that class:

vim search and replace

vi/vim search and replace FAQ: How do I search and replace in vim?

A lot of people ask me how to perform a global search and replace operation in the vi (vim) editor. The vim editor is anything but intuitive, but for some reason I can remember this global search and replace syntax pretty easily.