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
const log = new Proxy({}, { | |
get: (_, colour) => function() { | |
console.log(`%c ${[].slice.call(arguments).join(' ')}`, `color: ${colour}`) | |
} | |
}) | |
// example | |
log.tomato('I am tomato') | |
log.chocolate('I am chocolate') | |
log.cornflowerblue('I am cornflowerblue') |
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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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
#!/usr/bin/python | |
''' | |
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2 | |
Correct PIN for hash and salt below is 1234. | |
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone | |
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
#!/usr/bin/env python | |
# zmqc: a small but powerful command-line interface to ZMQ. | |
## Usage: | |
# zmqc [-0] (-r | -w) (-b | -c) SOCK_TYPE [-o SOCK_OPT=VALUE...] address [address ...] | |
## Examples: | |
# zmqc -rc SUB 'tcp://127.0.0.1:5000' | |
# | |
# Subscribe to 'tcp://127.0.0.1:5000', reading messages from it and printing |
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
// WARNING: Requires C99 compatible compiler | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include "heap.h" | |
#define CMP(a, b) ((a) >= (b)) | |
static const unsigned int base_size = 4; |