Hi!

Welcome to my little place on github pages.

I'm a developer and a course instructor. I teach courses on web development, JavaScript, C# and more.

When I'm not working, I try to spend most my time with my family and friends. I might be skiing (mostly downhill), flying drones, riding my motorcycle, be out photographing (you can see some of my photos on Flickr) or just doing even more programming.

Thanks for stopping by, hope you find something useful here, in one of my Github repos, gists or in the archives of my old blog!

-Arjan Einbu

Different ways to search a git repo

  • git log -S <string> will look for the commits that change the number of occurrences. This will find when something was added or removed, but not just moved to somewhere else inside the same commit.
  • git log -S <regex> --pickaxe-regex Same as above, but with regex support.
  • git log -G <regex> will look for the commits where a change involves this regex or text. It will find when it has been moved, as well as added or removed.
  • git log --grep=<pattern> searches in commit messages only.
Read my Gist about it.

Practical npm packages

These packages are lightweight, standalone and non-intrusive.

@aeinbu/groupby

The npm package @aeinbu/groupby contains some handy functions for doing "group by" type transformations with array.reduce(...).

Example:
cities.reduce(groupBy(x => x.country), [])

Check out the code and the full README on github

@aeinbu/aggregates

The npm package @aeinbu/aggregates contains some handy variations over min/max and sum functions to use with array.reduce(...).

Example:
capitals.reduce(maxBy(x => x.population), null)

Check out the code and the full README on github

Tarifa, EspaƱa

Console debuging snippets for js/jsx/ts/tsx

When debugging complex chained collection expressions or promise chains, it is often helpfull to see intermediate results in between the different chained steps.

These one-liners let you achieve this without breaking up your code to insert temporaty variable.

Read the instructions and get the snippets here

Scientific progress goes boink!
Calvin & Hobbes

Adding a new disk to my Linux computer

I just did a clean install of Linux Mint in my quest to better know Linux.

One of the first obstacles I met was how to utilize my computer's second hard drive.

Lemmings: It turns out they aren't blue at all!
The good,
the bad and the
uglified
#javascript

Did you know?

The layout and styling of this website are open sourced under the MIT license. You can find the source for it here!

Running a docker container

I needed to run pre-made docker container, so that I easily could test Redis, MS SQL Server, mongoDB etc without doing a full install of the products on my computer.

Since the packages where made and just needed some configuration to get started using them, I wrote a small post on how to.

I have used them on my mac, but the procedure should be the same for different Linuxes and Windows versions too.

Me, driving in Nevada
Republished from 2009!

Mythbusters: Unit-testing

I found a question titled: "Why is code quality not popular?" on Stackoverflow yesterday.

Several people had listed reasons for not doing unit testing. There were a lot of misconceptions there.

Here are the main reasons mentioned against unit testing (the myths) with my response:

My webpack templates

These templates should get you started developing your web ideas.

The templates are framework neutral starter kits for building web apps or npm packaged components with Webpack and Babel.

They come with tools for testing them in the development web server, and building the static assets to publish on your web server.