Skip to content

Instantly share code, notes, and snippets.

View maximilian-lindsey's full-sized avatar

Maximilian Lindsey maximilian-lindsey

View GitHub Profile
@maximilian-lindsey
maximilian-lindsey / duplicate.js
Created November 4, 2020 15:53
Duplicate content with JS
const fs = require('fs-extra');
const glob = require('glob');
const promisify = require('util.promisify');
const globAsync = promisify(glob);
const getAllFiles = async () => {
const allFiles = await globAsync('../content/**/*.de.md');
for (const file of allFiles) {
await fs.copy(file, file.replace('.de.md','.test.md'));
@maximilian-lindsey
maximilian-lindsey / lazy-image-placeholder.html
Created April 8, 2019 11:56
Lazy loaded image placeholder
<!-- Source: https://twitter.com/etportis/status/1113887359555100672 -->
<img src="data:image/svg+xml;charset=utf-8,
<svg xmlns='http://www.w3.org/2000/svg '
width='1280' height='720' />"
data-src="lazy.jpg"
alt="A lazy Jpeg" />
@maximilian-lindsey
maximilian-lindsey / docker-stop-and-prune-all.sh
Last active July 11, 2018 11:52
Docker stop and prune all
# stop all
docker stop $(docker ps -a -q)
# prune
docker system prune --all
# volume prune
docker volume prune
@maximilian-lindsey
maximilian-lindsey / sqlite3_electron_windows_integration.md
Last active August 29, 2021 14:55
SQLite3 Electron windows integration

SQLite3 Electron windows integration

This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron

Install sqlite3

npm install sqlite3 --save
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active March 14, 2024 12:28
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@maximilian-lindsey
maximilian-lindsey / node_serialport_windows.md
Last active October 28, 2022 09:12
Node.js and Serialport on Windows 7 to connect your Ardunio or other cool devices

Node.js and serialport with Windows 7

This is a short example how to get the Node.js package serialport up and running with Windows 7 (this should also work for higher versions of Windows, but I didn't test that).

By using this package, you will be able to send and receive data to and from the serial port of your Arduino or any other device, using this port.

Installation

As of September 16, 2015, serialport does not compile using Node.js version: v4.0.0