All posts by JackC27

The incredible power of the Watson API

I just rounded the corner of building a small extension using the Watson API. It just tells you the type of tone a certain piece of writing contains. Watson does way more. For FREE! Yes the IBM Watson that whooped Jeoparday’s ass a few years back. You can talk to it with Javascript. Are you kidding me!? How is everybody not trying to do this? You can get started by clicking here. You don’t even need to know how to program to just explore and see what it can do. Demos that are already set up for you.
Watson Logo

Open a file in an app via command line(OSX)

This is very simple to implement and saves some time clicking around.

In terminal you can use this line of code.
open -a Brackets serve.go

open = self explanatory
-a = access any application
Brackets = can be any app you have in your applications folder. The file will be opened in this app.
serve.go = any filename that currently exists in the directory that you are in.

If you need to create a file use:
touch filename
If you need to create a directory:
mkdir foldername
If you need to move to the directory you just created use:
cd foldername

You can learn more here:
https://www.codecademy.com/courses/learn-the-command-line

Attaching variables to the window object

Concepts and other code to remember

Some interesting logs to the console. I took a few seconds to ponder the following boolean interrogations after watching this video here.

var a = 1;
var b = "Jack";

function foo(){
    var a = "Jack"
    console.log(window.a);
    console.log(a);
    console.log(this.a);
    console.log(window.a == a);
    console.log(this.a == window.a);
    console.log(a == window.b);
    console.log(b == a);
    console.log(this.b == this.a);
};

foo();

Results in… (click to enlarge)


Screen Shot 2015-02-10 at 4.21.41 PM