This file contains hidden or 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
| (ns demo.core-test | |
| (:require [cljs.test :refer [deftest | |
| testing | |
| is | |
| use-fixtures]] | |
| [clojure.string :refer [lower-case]] | |
| [demo.components :refer [title-component | |
| counter-component]] | |
| [reagent.core :as r] | |
| ["react-testing-library" :as rtl])) |
This file contains hidden or 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 hidden or 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 hidden or 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
| 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() { |
This file contains hidden or 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 hidden or 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(); |