Skip to content

Instantly share code, notes, and snippets.

View heijmerikx's full-sized avatar

Rutger Heijmerikx heijmerikx

View GitHub Profile
@vlucas
vlucas / encryption.js
Last active June 1, 2024 12:17
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@evgeniy-trebin
evgeniy-trebin / brew_elasticsearch.sh
Last active September 21, 2022 22:39
How to install specific version of elasticsearch via brew
brew tap homebrew/versions
brew cask install java
brew search elasticsearch
brew install elasticsearch@2.3
brew services start elasticsearch@2.3
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active May 7, 2024 04:49
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@stardigits
stardigits / how-to-install-vscode-on-mxlinux-19.5.md
Created July 4, 2020 15:13
How to Install Visual Studio Code on MX Linux 19.5 (Debian 10)
esphome:
name: "air-quality-indoor"
platform: ESP32
board: "featheresp32"
wifi:
ssid: "YOUR WIFI NETWORK NAME"
password: "YOUR WIFI PASSWORD"
logger: