Skip to content

Instantly share code, notes, and snippets.

# Workaround for
# Copy the script to /lib/systemd/system-sleep/
case $1 in
for mod in $SUSPEND_MODULES; do
rmmod $mod
vlucas / encryption.js
Last active Nov 24, 2021
Stronger Encryption and Decryption in Node.js
View encryption.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);
bastman /
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
jfsiii / index.html
Last active Jan 4, 2021
Full-Screen Layout using Flexbox
View index.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title>Holy Grail</title>
/* some basic styles. nothing to do with flexbox */
header, footer,
nav, article, aside {
border: 1px solid black;
SchizoDuckie / apf_release.prepend.js
Created Mar 20, 2012
Cloud9 IDE Touch Enabler Monkeypatch
View apf_release.prepend.js
* A proof of concept monkeypatch to make Cloud9 IDE work on a tablet.
* Since i'm an extremely lazy bastard I prepended this snippet directly in package/client/js/apf_release.js
* What does it do?
* - It fires a doubleclick for a 2-finger tap
* - It fires a mousewheel up / down event for a 2-finger swipe up / down.
* How does it work?
* Prepend the functions below to <cloud9>/package/client/js/apf_release.js, save, load in tablet.