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
| // this doesn't work... I want to extract types from the process.env, and ensure they're required...! | |
| // not an easy task it seems | |
| function safeLoadEnv<T, K extends keyof T>(env: T, ...keys: Array<K>): Required<Pick<T, K>> { | |
| // extension of https://stackoverflow.com/a/47232883 | |
| function pick(obj: T, ...keys: Array<K>): Pick<T, K> { | |
| const ret: Partial<Pick<T, K>> = {}; | |
| const missing: any = []; | |
| keys.forEach(key => { | |
| if (!obj[key]) { |
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
| #!/bin/bash | |
| for i in {1..1000}; do | |
| x="$RANDOM""$RANDOM" | |
| echo -n "$x " | |
| echo -n "$x" | shasum -a 1 | |
| done; |
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
| #include <string.h> | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <openssl/sha.h> | |
| #include <stdlib.h> | |
| // compile with gcc -lcrypto -std=c11 brute.c -o brute | |
| // run with ./brute <prevhash> | |
| static char lastHash[2 * SHA_DIGEST_LENGTH + 1]; |
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
| #!/bin/bash | |
| set -eu | |
| hash1="$1" | |
| for word in $(cat /usr/share/dict/words); do | |
| if shasum -a 1 <(printf "%s\0%s" "$hash1" "$word") | grep '^00'; then | |
| echo $word | |
| fi | |
| done |
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
| /* Includes ------------------------------------------------------------------*/ | |
| #include "DEV_Config.h" | |
| #include "EPD.h" | |
| #include "GUI_Paint.h" | |
| #include "ImageData.h" | |
| #include <stdlib.h> | |
| // If this is enabled (set to 1), partial refresh doesn't work as expected, and | |
| // the demo is a bit glitchy otherwise too./* Includes ------------------------------------------------------------------*/ |
OlderNewer