Skip to content

Instantly share code, notes, and snippets.

Avatar

Maximilian Lindsey maximilian-lindsey

View GitHub Profile
@maximilian-lindsey
maximilian-lindsey / duplicate.js
Created Nov 4, 2020
Duplicate content with JS
View duplicate.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'));
View lazy-image-placeholder.html
<!-- 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" />
View docker-stop-and-prune-all.sh
# stop all
docker stop $(docker ps -a -q)
# prune
docker system prune --all
# volume prune
docker volume prune
View sqlite3_electron_windows_integration.md

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 Apr 1, 2022
How to run Express inside an Electron app
View express_in_electron.md

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 Mar 1, 2022
Node.js and Serialport on Windows 7 to connect your Ardunio or other cool devices
View node_serialport_windows.md

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