Not using versioning on your configuration files and editing them with Vim?
Use Vim’s backup option to automatically keep a copy of past versions. To put in your ~/.vimrc:
"Turn on backup option
set backup| import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
| const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
| const IV_LENGTH: number = 16; // For AES, this is always 16 | |
| /** | |
| * Will generate valid encryption keys for use | |
| * Not used in the code below, but generate one and store it in ENV for your own purposes | |
| */ | |
| export function keyGen() { | 
| # Example for MySQL 5.7 how to use JOIN on 2 tables without junction table using new JSON column type. | |
| # Let say we have 2 tables: posts and users | |
| # Users may like posts | |
| # We store the IDs of users who liked each post in posts.liked column which is a JSON array | |
| # which might have a content like "[1, 2, 5, 10]" | |
| SELECT posts.id AS post_id, users.id AS liked_by_user_id FROM posts JOIN users ON JSON_CONTAINS(posts.liked, CAST(users.id AS CHAR)) | 
| #!/bin/bash | |
| # | |
| # GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script: | |
| # http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go | |
| # | |
| # To use: | |
| # | |
| # $ cd ~/path-to/my-awesome-project | |
| # $ go-build-all | |
| # | 
| import java.io.IOException; | |
| import java.net.URLClassLoader; | |
| import java.nio.file.Files; | |
| import java.nio.file.Paths; | |
| import java.nio.file.Path; | |
| /** | |
| * Example demonstrating a ClassLoader leak. | |
| * | |
| * <p>To see it in action, copy this file to a temp directory somewhere, | 
| CREATE FUNCTION dbo.HMAC ( | |
| @algo VARCHAR(20) | |
| ,@key VARBINARY(MAX) | |
| ,@data VARBINARY(MAX) | |
| ) | |
| /* This function only takes VARBINARY parameters instead of VARCHAR | |
| to prevent problems with implicit conversion from NVARCHAR to VARCHAR | |
| which result in incorrect hashes for inputs including non-ASCII characters. | |
| Always cast @key and @data parameters to VARBINARY when using this function. | |
| Tested against HMAC vectors for MD5 and SHA1 from RFC 2202 */ |