WebStorm: code completion, everywhere!

I’ve been taking the 30 day eval of WebStorm for a spin. I’ve watched a few videos of people hacking on code in Javascript with various frameworks and libraries, and what’s really impressive is the speed that they manage to type code taking advantage of WebStorm’s code complete features.

I haven’t really thought about this too much as you take for granted what you’re used to, but in other IDEs like Eclipse and Netbeans, most of the code complete features center around offering properties and methods on a Class after you type ‘.’ or Ctrl-Space – or at least that’s the way I’ve always thought how code complete works in those IDEs.

In Webstorm you get the same popup complete after a ‘.’ or on pressing Ctrl-Space. In addition though, if you start typing the first few letters and press return, if there’s anything matching those first few letters then it inserts that text, or shows you possible alternatives.

For example, if you type fu[Enter], you get:

[code]function () {

}[/code]

This saves some typing for sure, but what’s pretty cool is that the code complete can vary based on the *.js files you have imported using <script> in an HTML file, or other selected Libraries from the Preferences/Languages and Frameworks/JavaScript/Libraries. Which pretty much means you get code-complete on anything, anywhere in your source. Now that’s pretty cool.

There’s a great walkthrough of some of these features in this video from the guys at JetBrains:

WebStorm: adding library support for Jasmine

WebStorm provides support to download libraries to provide code complete for a huge number of popular libraries.

I tried to add a Library for Jasmine manually, but really wasn’t sure where to point to, I tried pointing to here, but this didn’t seem to work for me:

/usr/local/lib/node_modules/karma-jasmine

If you press the Download button on the right, you can search for a known library and install it like this:

I think part of what I was looking for was jasmine and karma-jasmine, but installing from the Download option got these setup for me, and now I’ve got the code complete in my Jasmine tests that I was looking for.

Raspbian fsck fails on boot

I used

sudo touch /forcefsck

to set my Pi to run a fsck at boot, but it failed with this message:

"An automatic check (fsck) of the root filesystem failed. A manual fsck must 
be performed, then the system restarted. The fsck should be performed in 
maintenance mode with the root filesystem mounted in read-only mode"

I ran  sudo fsck /dev/mmcblk0p2 – there was a couple of errors that required a ‘y’ to fix, and then it completed. Rebooted, and back to normal. Similar discussion on this message here.

Setting up an automated Raspberry Pi broadband speed monitor

Based on this Make article:

http://makezine.com/projects/send-ticket-isp-when-your-internet-drops/

Grab the scripts:

sudo apt-get install python-pip
sudo pip install speedtest-cli
git clone https://github.com/HenrikBengtsson/speedtest-cli-extras.git

Create an IFTTT account and add the ‘If Maker then Google Drive‘ recipe to your account. This step deserves further investigation… this is an incredibly easy way to integrate access to online accounts (Twitter, Facebook, Google etc) and trigger writing messages to them via a REST based api call. Very, very cool.

After you’ve done the above, while logged on to IFTTT, click Channels in the top right, find the Maker channel and click it, and you’ll find your secret key value to use in the next script.

Copy script from this Gist, modify to add your secret key from above setup:

https://gist.github.com/aallan/bafc70a347f3b9526d30

At this point you can follow the other steps in the Maker article to set up to run the script using cron, and you’re all set!