I’ve just got featured on the Livecoding.tv blog for a stream that I did for trying out Phaser the HTML5 game framework. I was trying to build the game snake, having the community chip in was really interesting while you develop the game. It was like a massive mobbing session.
Had a great opportunity to go to Full Stack Fest this year at Barcelona! Absolutely loved the event conference, got to meet a lot of cool people from all over the world!
See if you can spot me~ 😜
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:
- A Raspberry Pi
- WD My Passport Ultra 1TB USB 3.0 Portable Drive
- AmazonBasics 7-Port Powered USB 2.0 Hub
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.
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:
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.
1 2 3 4 5 6 7 8
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
To get round this you need to use the good old
setTimeout method like so:
1 2 3 4 5 6 7 8 9 10 11 12
In my opinion the
waitsFor function still has a place in Jasmine, the
done callback syntax doesn’t completely replaces
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.
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.
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…
Tap Tap Tap.
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:
Hide hidden files and folders:
Disable Mac’s Dashboard
I personally never found Dashboard useful, and i only ever opened it by accident, heres how you can disable it:
To re-enable the Dashboard:
Previous Commands You’ve Used
I use to do something like this to get a previous command I’ve entered:
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 :)
iTerm2 is an free terminal emulator for Mac OS X.
Here are some useful & interesting iTerm hotkeys i’ve discoverd along the way;
|All panes Input||
|split pane (h)||
|split pane (v)||
I have also set up some custom hotkeys for myself:
|⌘ ←||“HEX CODE”||
||Jump to beginning of the line|
|⌘ ➝||“HEX CODE”||
||Jump to end of the line|
|⌘ Backspace||“HEX CODE”||
||Delete current line|
|⌥ ←||“ESCAPE SEQ”||
||Jumo to beginning of the word|
|⌥ ➝||“ESCAPE SEQ”||
||Jumo to end of the word|
|⌥ Backspace||“HEX CODE”||
You can set up iterm to act like a “visor”, similar to how the Quake’s terminal / Guake works. This has an advantage of getting to your termals quickly among other things you’ve had opened on your screen.
First you will need to set up a hotkey, I’ve got mine to use
Then inside your terminal’s profile, set the style to something other than the default normal option.
I’ve also unchecked the default option for Confirm “Quit iTerm2” window.
I find this gets in the way everytime I shutdown my Mac, it pops up & I need to click it again to not let it stop the the shutdown process.
If you often find yourself spliting panes in your terminal window, I highly recommend setting up a Window Arrangement profile to save you time.
On my 15” macbook pro i set my a workspace which consist of 3 panes (shown below), Once your happy with your setup, you can save it by
Cmd + Shift + S.
I also set up a hotkey for mine to quickly bring up a new terminal window with the predefined panes.
You got any awsome tips I’ve not mentioned? Let us know from leaving a comment :)