• 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
    https://unix.stackexchange.com/questions/3747/understanding-the-exclamation-mark-in-bash
  • 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.

https://github.com/prisma/migrate

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:

Image for post
Image for post

The reason is that browsers are weird and developers don’t use the same way to recognize which character was pressed. …


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 and there is no way that you can do it as easy as before, you will have do dig manually down throw the components yourself. …


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 can…


Image for post
Image for post
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 and keeps a scale. That can be archived by using margin and have the iframe within, scale to 100% in both width and height and then limit the height to “56.25%” …


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 …


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. …


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 an <input/>, I figure this is how you uses onChange…


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 more a more popular it would also become a bigger and bigger target for hackers as more and more people install packages that could contain malicious code. The response was there was not much to do and we must wait and see, and it is also easy to go around cry wolf at everybody. …

About

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