This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.UserAvatar { | |
--UserAvatarColor: #000; | |
--UserAvatarSize: 40px; | |
position: relative; | |
border-radius: 100%; | |
text-align: center; | |
background-color: var(--UserAvatarColor); | |
font-size: var(--UserAvatarSize); | |
height: var(--UserAvatarSize); | |
width: var(--UserAvatarSize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-key | |
[prefix key] | |
(if (nil? prefix) | |
key | |
(str prefix "-" key))) | |
(defn flatten-map-kvs | |
([map] (flatten-map-kvs map nil)) | |
([map prefix] | |
(reduce | |
(fn [memo [k v]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// | |
// function loader() { | |
// return new Promise((resolve) => { | |
// if (process.env.LAZY_LOAD) { | |
// require.ensure([], (require) => { | |
// resolve(require('./SomeComponent').default); | |
// }); | |
// } | |
// }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public byte[] getPdf(String html) { | |
byte[] results = null; | |
try { | |
// For piping in and out, we need separate args for this for some reason | |
String[] command = {"/usr/local/bin/wkhtmltopdf", "-", "-"}; | |
ProcessBuilder builder = new ProcessBuilder(command); | |
// this eats up stderr but prevents us from having to handle it ourselves | |
builder.redirectErrorStream(false); | |
Process process = builder.start(); |