SBT: How to get started using the Build.scala file (instead of build.sbt)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.16, “Using Build.scala Instead of build.sbt.”


In an SBT project, you want to use the project/Build.scala file instead of build.sbt to define your Scala project, or you need some examples of how to use Build.scala to solve build problems that can’t be handled in build.sbt.

How to “pin” a screen in Android 5 (Android screen pinning)

Android FAQ: How do I “pin” a screen in Android?

Pinning a screen in Android requires a setting change. Once you’ve made that change, you can “pin” a screen so it is always shown when you log into your Android device. Here’s how to do it.

Android screen pinning setting

To pin a screen in Android, you first have to go into your settings and make a change. So go to the Settings app, then tap Security. When you scroll down you’ll see a “Screen pinning” setting, as shown here:

How to restore an Android emulator to its initial "factory" settings (wipe the data)

To restore an Android emulator to its initial, default settings, you need to find its “image” file on your filesystem and delete it. The image file will be found in your $HOME/.android/avd/<avdname>.avd folder.

For example, I was just working with an AVD named Nexus_6_API_21, and its directory on my Mac OS X system is /Users/al/.android/avd/Nexus_6_API_21.avd. I moved into that directory and found several “.img” files, deleted them, and then restarted the emulator, and it went back to its default settings.

How to turn off (disable) iOS AMBER alerts

After a long day of work I had climbed into bed, looking for a good night’s sleep, when suddenly my iPhone began making some bizarre, very unexpected noise. When I picked up the phone and looked at it, I saw an AMBER alert in Oklahoma had triggered an alert on my iPhone.

How to read/access Play Framework application.conf properties

Here’s a quick look at how to read Play Framework application.conf configuration properties.

First, given a Play application.conf file with these properties:



stations = [ 99.5, 102.3, 104.3, 105.9 ]

streams = [
    { "name": "104.3", "file": "104_3.pls" },
    { "name": "WGN",   "file": "wgn.pls" }

You can read the foo property (as a String) from your Play code like this:

Things I don't like about Mac OS X 10.9

I like many things that Apple does from a design perspective, and I hate to be too critical, but after upgrading my old iMac to Mac OS X 10.9, I honestly can't think of anything I like better from a UX perspective in OS X 10.9 compared to OS X 10.6. Rather than just say, “I don’t like 10.9” and keep whining about it, I started to keep a list of the things I don't like about 10.9, and it goes something like this:

How to schedule an automatic Mac wake up time

Summary: How to schedule a Mac automatic wake up time (or sleep time).

While answering a reader's question about an unrelated Mac issue, I stumbled onto a solution of how to wake up my Mac at a specific time every day. This is very cool for me, because it fits in very well with my Mac AppleScript iTunes alarm clock.

Drupal database configuration files - development, testing, and production environments

Drupal database configuration file FAQ: Is there something I can do to quit having to change my Drupal settings.php file every time I go from my Development Environment to Testing and Production?

Yes! One of the things I didn't like about Drupal when I first started working with it was the settings.php file in the sites/default directory. I thought that was THE database configuration file, and you had to keep changing it when you went from Development to Testing to Production.