Hjertnes.blog

My pile of Instapaper automation hacks

May 03, 2019

I try to automate stuff in my life to remove friction. One of these areas are sharing cool or interesting links I’ve read. The way I do this is that I mark them with a heart in Instapaper, then I copy the links out and post it before I remove the heart and start over. This would be a really simple task to automate through their API, if they’d bother to answer my request for an token.

The result is that I wrote this script. It is on NPM and you can run it with something like npx @hjertnes/likes ./pathToFile.csv. The way it works is that you download a CSV export from Instapaper, point the script at the file and it puts the links as a list of markdown links on your pasteboard. Then I paste it into a markdown file and publish it.

Then I paste this Object.values($(".action_link.star_toggle.starred")).map(x => $.get(x.href).then(y => {})) piece of Javascript in the console in the browser with the Likes section of the Instapaper website open, then I refresh and repeat until it’s empty.

That’s it. All of it would be a hell of a lot faster, cleaner if I got access to a proper API.

Likes

May 03, 2019

Write a notefor yourself at the end of the day

April 28, 2019

When I left the startup I was working for and started to have a normal relationship to work, and leave it at the office I started to have a problem with remembering where I left off when I got back to the office.

For a while I continued not doing anything about it, but then it started to become ridicolus spending like 15 minutes trying to figure out what I should be doing. So I added a Due reminder monday to friday to write a note for myself 20 minutes before I leave. Just a few lines to describe what I was doing and what I should get started on next.

It sounds kind of dumb, but have worked great.

Likes

April 28, 2019

First new post using Gatsby, I’ll post more about why soon. Anyways. Here is like since last week.

Instapaper likes

April 21, 2019

What's in my small bag

April 21, 2019

I have two bags I use a lot. One of them are the big one I wrote about a few days ago. That is a Fjellreven Foldstack No. 2 that I bring to work every day. My small bag is a Foldstack No. 3. I’ve had it for 4 years or so, and it is the thing I bring when I want to go light, but still want to bring more stuff than I can fit in my pockets. That usually means either when I’m hiking with Luna or going somewhere like to the city or visiting Ingri’s parents.

What I typically bring when I hike is:

  • My X-Pro 2 w/ the 23mm lens
  • Extra batteries
  • My Phone
  • Extra memory cards
  • My water bottle.
  • Bellroy Field Notes Case, plus a pencil and my Ystudio fountain pen

Or when we go somewhere:

  • My X-Pro 2 w/ the 23mm lens
  • The 50mm lens
  • Extra batteries
  • Extra memory cards
  • Phone, wallet, keys, cleaning cloth for my glasses
  • My kindle.
  • A small powerbank.
  • Bellroy Field Notes Case, plus a pencil and my Ystudio fountain pen

The thing I love about this bag is that you can bring a bunch of stuff with you, but not a lot.

Clojure cli and deps.edn

April 19, 2019

When I started to learn Clojure, there was two options: lein and boot. They were kind of the two big options to managing dependencies and building your project. Lein is this huge monolith that includes more or less everything you need and want, but you kind of need to build your project around how it works. And then you have boot that everyone likes better, but most people still use lein because it just works.

Then Cognitect released Deps.edn and the clj / clojure cli stuff. Edn is like JSON but more lispy, and deps.edn is a way you can define three different things: paths, deps and aliases. Paths are where you code is located, deps are your dependencies and aliases are just a way to write aliases for clojure/clj commands per project or globally. Where clj foobar expands to a longer clj command with a lot of options. Kind of similar to what you can do with the scripts stuff in node projects.

The cool thing about deps.edn is that you can add the file to a directory, add a few deps, run clj and it installs them and they are ready to be loaded from the repl. The reason this is interesting is because it only takes care of a few minor parts of what your projects neeed in a way where you can pick other tools to take care of the rest based on what you need. And because both boot and lein have their own ways of dealing with what deps.edn does it will be harder for them to adopt to this.

The way I look at it is that deps.edn provide all the “glue” that ties it all together. And then you just need to add what you need on top if it to get what you need, to build, pack and lint etc.

In my bag

April 18, 2019

I’ve been meaning to post this for a really long time. But every time I’ve gotten to it something new I planned to have in it was on the way to me. This is not just in my bag, but also stuff I have on me, in my pockets etc.

In my pockets / on my person {#in-my-pockets-on-my-person}

  • Glasses. Cheap Specsavers storebrand. They basically look like something Elvis Costello would have worn.
  • Apple Watch: Series 4: space gray with a sports loop.
  • Trove Wallet. Red and blue.
  • iPhone 8 Plus, space gray with a popsocket.
  • Keys: just a plain key bring with one of Luna’s old dog tags on it.
  • A piece of cloth to clean my glasses.
  • Bellroy Field Notes case, with Field Notes, some Index Cards and a Golden Bear pencil in the spine
  • A YStudio Fountain pen is always in my pocket.

In my Bag. {#in-my-bag.}

  • Misc cables: USB-C to USB-C, USB-A to micro-USB, Lightning USB-C, USB-A Apple Watch charger.
  • Mophie XXL powerbank.
  • Nintendo Switch
  • Kindle Paperwhite 2008.
  • Nock Co Seed A5 case, with a LT1917 Bulletjournal notebook and a Lamy 1.
  • Nock Co Pencil Case with a lot of Golden Bears. I use it to bring sharp pencils to work and bring dull ones back. Usually around 12 in it.
  • Audio-technica ATH-M50x headphones
  • A few Lightning to jack dongles.
  • LT A few lines a day 5 year journal.
  • My work ID/key card, paracetanol, fishermans friends.
  • My 24H Water bottle. Keeps my icewater cold for at least 24 hours.
  • Contigo coffee mug. I’m going to replace this with a more durable one in not too long.

Emacs, flycheck and eslint

April 14, 2019

The first thing I did was to disable eshint and standard.

Then make sure you have a .eslintrc or .eslintrc.js file in your repo; one of them is sufficient.

The next step is to install eslint and all your plugins, configs etc globally (yarn global add or npm i -g). There are ways to get it to work with per project installs, but this is way easier.

Then make sure eslint works. just run eslint —print-config . until it prints the config. Then run M-x flycheck-validate-setup (double check this command) and make sure it work, and restart emacs. And that should be it.

Likes from my Instapaper

April 12, 2019

A while since last time, I wanted to automate this process a little bit. Then I didn’t hear back from Instapaper about a API token and I went for a less ideal solution. It is a lot better though. Long story short, I wrote a node script that parses a exported csv files. I’ll probably get it up on Github soon, I just need to clean it up. And I’ll probably get back to doing this weekly now that it takes much closer to a few minutes, than 15.