• Don’t include $ because that is seen as a bash variable even if you wrap your string in double quotes, it only works if escaped by single quotes.
  • Single and double quotes, just annoying to escape
  • Exclamation mark
  • Backslash
  • Number sign #
    Editors in general thinks everything after is a comment
  • Equal signs
    Generally okay, as they are part of base64 etc., but try to avoid it as it is generally something with equality

Prisma Migrate is amazing, it helps you manage your database and generates typings for your database schema automatic.


However you can still make mistakes that takes down your app, so here is the rules:

You can not add and delete columns in same release

If you add columns, migrate first and deploy.

When deployed to production, Prisma will try to select the column and if you did not migrate first the column will not exist and your code will fail.

If you delete columns, deploy first and migrate.

If you migrate first, the column will disappear in production and your old code still expects to find the column. …

Using keyboard shortcuts are important both if you have accessibility problems but also just in general as it is much more precise using the keyboard than reaching out for the mouse and pointing.

Sadly keyboard shortcuts never seem to work probably if you are using a non-english keyboard layout, but why is that? You would think that typing “Shift+?” would give the same result no matter which language you speak and the same “/”.

On facebook you can get this menu if you type “Shift+?”, but typing “/” does not work on a danish keyboard layout:

The reason is that…

If you are using web components with LitElement for example, and then you try to use document.querySelector and it doesn’t find anything in the document, but you can clearly see it in the developer tools. Super annoying and then you search for “document.querySelector web components” and no good results come up! okay, everything is super annoying right now!

The reason is that web components can use the new ShadowDom, which encapsulate the DOM elements that can be attached to the DOM. You actually don’t have to use ShadowDom, but it more the rule than the outlier.

Show how do you query shadowdom?

It is more complicated…

Sun Mar 31 2019 16:07:41 GMT+0200 (Central European Summer Time)

Wouldn’t it be cool if you could just write a command in your terminal and switch to your AirPods instead of having to use the Menubar Bluetooth menu or the Sound Icon.

We can install a cli that can control Bluetooth with brew.sh

$ brew install bluetoothconnector

Then we can connect to your Airpods by using:

$ BluetoothConnector -c MAC-ADDRESS --notify

We can find our airpods mac address by running:

$ system_profiler SPBluetoothDataType

Look for your AirPods name and copy the address:

Mine is an example: 8C-04-D0-96-55-CC

Then now we…

Youtube embed which is not responsive :(

In this article, you will learn how to make a react component that you can use to make a responsive youtube embed react component.

Once you embed your first youtube video, you quickly realize that it is not responsive and that it breaks your design.

Sadly iframes can’t keep it ratio by itself as the domain is a third party, you are not allowed to know the content of the iframe for security and privacy reasons.

So what can you do?

We can make a div that wraps the embed and that scales by default to the window or parent…

Wed Dec 19 2018 01:52:29 GMT+0100 (CET)

I use Kubernetes for work and helps other uses Kubernetes, but my recommendation for people making side-projects is to not use Kubernetes, it has a lot of overhead compared to if the focus on side-projects is that it should run cheaply.

But what is the least expensive Google Cloud Kubernetes cluster you can run?

So looking at it Google Cloud has one instance type that is 1.7 GB memory and 0.5 …

Tue Dec 18 2018 18:36:49 GMT+0100 (CET)

So I wanted to try to see what Google knew about me because of all the talks about moving away from Google and keeping privacy. So Google has this page MyActivity where you easily can see your latest activities, but it is nearly useless in going back in history for many years. After googling how to export my google history I found you have to click the three dots in the corner and click “Other activities” and then find the paragraph about “Download your data ..” and then finally you get to an…

Sat Dec 15 2018 15:05:58 GMT+0100 (CET)

I am creating a new application with LitElement and LitHtml and it works pretty well, at the start it was just to show data, but then I had to handle input tags with onchange event handlers, and I could not figure out how! I have used React and was used to writing:

<input type="text" onChange={e => console.log(e.target.value)} />

But that didn’t work of course, that is JSX and lit-element uses template literal, so it had to be something with ${} .

So after reading the documentation but not finding a single example with…

Wed Dec 12 2018 21:24:00 GMT+0100 (CET)

Now there is another example of an npm package that contains malicious code, and it happened exactly how you would have predicted. A social attack to get publishing access, not to a popular package, but to a package that a popular package depends on.

The hack was pretty genius and not a script kiddie like, as it code was encrypted and could only be decrypted by the package “bitpay/copay” module description. Not something you would immediately discover.

I was at Node.js Interactive in 2016 and did ask a few people as Node.js got…

Kevin Simper

I really like building stuff with React.js and Docker and also Meetups ❤

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store