Tag Archives: Typescript

I made an nrk thing

Have you ever wanted to leisurely browse the subtitles for your favorite TV show? Does that specific show currently exist in the web player for the Norwegian Broadcasting Company? Boy do I have news for you!

It was made as a language learning aid, and it started as a very simple scraping app. The problem with that approach was that NRK kept changing their website so my app kept breaking. Recently I found out that they actually have an API for most of the stuff I needed, and now the app is stable enough to publish! I still have to scrape the website to figure out what shows are available, but after that we’re pretty stable.

I’m not a designer. Actually, I don’t have a single designer bone in my body, but I still did my best. The react app has drop shadows, and it’s somewhat responsive. All of which goes away when you want to print something. What more could you want?

If anyone wants to help me pick better colors, feel free to make a pull request to the repo! If you’re wondering how it looks on desktop, just run the docker container and find out! It’s all there in the readme.

Let’s do a song of the blog, it’s been a while.


I’m a wizard

Typescript is genius

I’m teaching myself typescript, because why not, and right off the bat I’m blown away by the genius that is using public as a prefix to constructor arguments.
If you haven’t seen it before, it looks like this:

class Human {
    constructor(public name, public age, public job){
        // do more constructor things here
    }
}


And that’s the same as doing this:

class Human {
    constructor(name, age, job){
        this.name = name;
        this.age = age;
        this.job = job;
    }
}


It just takes the argument and sets a field with that same name in the object! It’s not a revolutionary feature, but it saves so much time in the long run. Anyway, back to it. Look forward to reading about my journey through NativeScript soon, possibly, maybe.