Adrian Chen

Google Live Case Color - Pixel

Recently Bought a maps Live case for my google pixel from the google store. I spent some time choosing the color theme and the map location for my case. Just arrived today, the color on the case was way off, the black theme I selected was almost at a purple color, waited ages for the case to arrive as well 😩… This is what it looked like: "Google Map Live Case"

I’ve contacted the google’s team and let them know about the color issue, they say they are looking into it. Hopefully they can sort it out soon.

Raspberry Pi Torrent Box

gear, hardware, mini-project, pi, raspberry

With the new release of the Raspberry Pi 2, it reminded me of the old Raspberry Pi model B I have that’s covered in dust doing nothing. Feeling a bit sad for my Raspberry Pi I decided to turn it into something useful, a 24/7 bit torrent client. For downloading erm… all the public domain legal earth watching that I do.

The Pi’s power consumption is so low, it almost cost nothing on your electricity bill, and it’s passive cooling which means it noiseless.

I mostly followed this guide here on setting up Deluge the bit torrent client & samba share on the Raspberry Pi.

When I first tried out the guide, I had an self powered external hard drive that I plugged straight into the Pi, however when ever we try to access the files more than a minute, I would get an I/O error writing to ... then I would have to remount the drive on the pi. After trying out different combination of the format and partition of the hard disk… it turned out there was a power surge on the hard disk USB plug, when it connects to the Pi it would disrupt it’s operation.

This is my working solution:

"Setup of the Raspberry Pi torrent box using the powered usb hub and external hard drive"

I Added a powered usb hub between the Raspberry Pi and the external hard disk to make sure the hard disk is not drawing power from the Pi, and also changed the external hard disk to be one of the simple plug and play WD My Passport without any power source, this have been running smoothly without an issue so far for the past 2 months, quietly sitting on my shelf next the my router~ Hope this will help some of us who had the similar problem on external hard drive with the raspberry pi.

Quick PHP Server

gulp, impactjs, nodejs, php, workflow

I’ve been playing with ImpactJS for a while, I’ve found myself needing to run a php server to use it’s level editor Weltmister.

I didn’t want to install a full server stack solution like mamp, xampp, etc… As I already use gulp for the streaming build system. The simplest solution I’ve found is to run php and nodejs side by side. You can fire up a quick php server using it’s built-in web server:

$ cd ~/impactJs
$ php -S localhost:9090

How to Settimeout in Jasmine 2

jasmine, tdd, test, timeout

The waitsFor funciton for asynchronous specs have been removed in Jasmine 2, instead we have a done callback argument that when present, will make Jasmine consider its coresponding block as asynchronous, and waits for it to be invoked before timing out or finishing the spec, very similar to how Mocha does it’s async tests.

describe "When fetched", ->
  beforeEach: (done)->
          success: ->

  it "should update its stock price", ->

This is all well and good, until I ran into a problem when doing intergration test with my app that includes thrid party library that I can’t really dig into, in mycase it was the Google Maps API. To use the done syntax, you require to have an entry point of knowing when your ajax call finishes to raise the done event.

To get round this you need to use the good old setTimeout method like so:

describe "on running a search", ->
    it "returns places", (done) ->
        places = null
        $(searchBox).on "placesChanged", (e, data) ->
          places = data
          expect(places.length).toBeGreaterThan 0
        setInputVal = ->
          input.focus().simulate("keydown", { keyCode: 13 })
        # No way for us to know exactly when the Google SearchBox is ready for input ...
        setTimeout(setInputVal, 1000)

In my opinion the waitsFor function still has a place in Jasmine, the done callback syntax doesn’t completely replaces waitsFor.

Should You Buy a Cheap Apple Keyboard Knockoff

apple, gear, keyboards

Should You Buy a Cheap Apple Keyboard Knockoff?

I recently stumbled on an apple ‘like’ wireless keyboard called iWantIt it looks like the apple wireless keyboard but it’s 100% cheap plastic.

It was on offer for £ 8.99 in Currys (a British electrical retailer). It so happens I was looking at an official apple wireless keyboard the day before, which is selling for £53.99 at Amazon.

Cheap apple keyboard

At a first glance the layout is very similar to the apple keyboard, and with a price of £8.99. I thought this may work, and bought it…

TLDR: Should You Buy a Cheap Apple Keyboard knockoff? No, save up if your broke. So many flaws makes this un-usable.

When I rest my hand on top of the keyboard, first thing i noticed was the angle of this is steeper than the apple keyboard, you need to raise curl your fingers a bit more to type.


Whenever I press a key, the rest of the keyboard sort of cave in and bend into the pressure point of I’m typing, this may or may not be a problem for you, depending how hard you press down when typing.

There’s also a bit of a ‘recoil’ like shooting a gun in CoD. Soon as you gain some speed when typing, it would nudge and move a little on the table, and wouldn’t stay put.


This key on the top left… (You mean the esc key?) WRONG!!! It’s an home button… A freaking home button… To use it as an esc key, you have to hold down the fn key. I don’t know about you guys, but I tend press the esc key quite a lot, and so far this is driving me nuts.

esc key

I tried coming up with at least 1 good point about this keyboard, but I just can’t think of any.

So yeah kids… Don’t buy cheap apple keyboards knockoff…

Beginner’s Mac OS X Terminal Tips

CLI, Terminal, bash, commands

Just started using the terminal, want to know the basics? Here are some tips I wish someone had told me at the start. This guide is mainly aimed at Mac OS users, ( you’ve probably know that from the title. )

The terminal app you get from Mac OS is pretty basic. It comes with some preset themes, you have your Grass, Homebrew, Ocean, Red Sand, etc…


The standard Mac Terminal app is okay to begin with, I recommend taking a look at iTerm2, it has a lot more features and customisation, plus it’s free. I’ve also got a post on tips and tricks for iTerm2.

Open prompt / terminal’s location with Finder

Use the command open . will bring up Finder with the currently location of the prompt. No more opening up finder from the dock and re-navigating folders, great time saver!

How to Show Hidden Files and Folders on Mac Finder

Show hidden files and folders:

defaults write AppleShowAllFiles YES && killall Finder

Hide hidden files and folders:

defaults write AppleShowAllFiles NO && killall Finder

Disable Mac’s Dashboard

I personally never found Dashboard useful, and i only ever opened it by accident, heres how you can disable it:

defaults write mcx-disabled YES && killall Dock

To re-enable the Dashboard:

defaults write mcx-disabled NO && killall Dock

Previous Commands You’ve Used

I use to do something like this to get a previous command I’ve entered:

history | grep ssh

This would come back with a list of commands you have used containing ssh. You can replace that with whatever you’re looking for.

There’s a faster way to search history, simply press Ctrl + R key combo, and keep typing till you find what you’re looking for.

You have any tips you would like to share? leave a comment below :)