Skip to content

Instantly share code, notes, and snippets.

what's up

Patrik Toma patotoma

what's up
View GitHub Profile
andreasonny83 /
Created Jul 20, 2019
Run node app in background

Run node app in background

Running a script in the background in linux can be done using nohup, using nohup we can run node application in the background

$ nohup node server.js > /dev/null 2>&1 &
  • nohup means: Do not terminate this process even when the stty is cut off
  • > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output)
mindplay-dk / image-url.ts
Last active Jan 15, 2022
Rotate image preview to compensate for EXIF orientation (Javascript / Typescript)
View image-url.ts
// Based on:
* Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed.
* Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails.
export async function getImageUrl(file: File, maxWidth: number|undefined) {
return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999));
pbojinov /
Last active May 26, 2022
Two way iframe communication- Check out working example here:

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.


Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')