Skip to content

Instantly share code, notes, and snippets.

View FrankHassanabad's full-sized avatar
🎧
Eat Sleep Code Repeat

Frank Hassanabad FrankHassanabad

🎧
Eat Sleep Code Repeat
  • https://radicl.com/
  • Boulder, Co
View GitHub Profile
@FrankHassanabad
FrankHassanabad / medium_non_optimal_ui_3.sh
Last active July 27, 2018 14:52
For Non Optimal UI/UX medium article
http://localhost:8500/v1/kv/?recurse&pretty=true
...
{
"LockIndex": 0,
"Key": "application/configs/",
"Flags": 0,
"Value": null, <-- Wait, what's this null?
"CreateIndex": 73975,
"ModifyIndex": 73975
@FrankHassanabad
FrankHassanabad / medium_non_optimal_ui_2.sh
Created July 27, 2018 14:48
For Medium Article (Non Optimal UI/UX)
...
018-07-26T10:08:14.055-06:00 [INFO] [test_application] The parameter is incorrect
(application crashes)
...
@FrankHassanabad
FrankHassanabad / medium_non_optimal_ui.sh
Created July 27, 2018 14:45
For Medium Article (Non Optimal UI)
...
2018-07-25T09:55:09.851-06:00 [INFO] [test_application] setting to
...
@FrankHassanabad
FrankHassanabad / bathroom-correction-at-work.py
Created June 20, 2018 00:44
Correction fo prime numbers
import math
# This as written will fail saying 1 and 4 are prime.
# Those two numbers are not prime.
# Also, checking up to square root is more efficient.
def IsPrime(n):
if (n == 1 or n == 4):
return False
for divisor in range(2, int(math.ceil(math.sqrt(n)))):
if n % divisor == 0:
@FrankHassanabad
FrankHassanabad / mdn_crypto.js
Created March 18, 2018 17:25
MDN Crypto Example
/* assuming that window.crypto.getRandomValues is available */
var array = new Uint32Array(10);
window.crypto.getRandomValues(array);
console.log("Your lucky numbers:");
for (var i = 0; i < array.length; i++) {
console.log(array[i]);
}
@FrankHassanabad
FrankHassanabad / openssl_example.sh
Created March 17, 2018 21:59
Openssl key generation example
openssl genrsa -aes128 -out private.key 2048
Generating RSA private key, 2048 bit long modulus
....+++ ....… +++
e is 65537 (0x10001)
Enter pass phrase for private.key: ****************
Verifying - Enter pass phrase for fd.key: ****************
@FrankHassanabad
FrankHassanabad / crib-phone-example-2.js
Last active March 17, 2018 21:43
Crib drag example 2
encryptedPhoneNumbers.forEach((encryptedPhoneNumber) => {
const xor = xorStrings(encryptedPhoneNumber, exactMatch);
const output = xorPlainTextWithCrib(xor, inputPhoneNum);
printPlain(output);
});
@FrankHassanabad
FrankHassanabad / crib-phone-example.js
Created March 17, 2018 20:45
Crib phone example
for (let i = 0; i < encryptedPhoneNumbers.length - 1; ++i) {
const encryptedPhoneNum1 = encryptedPhoneNumbers[i];
const encryptedPhoneNum2 = encryptedPhoneNumbers[i + 1];
const xor = xorStrings(encryptedPhoneNum1, encryptedPhoneNum2);
const output = xorPlainTextWithCrib(xor, inputPhoneNum);
if (asciiMatch(output, '^[0-9]+\-[0-9]+\-[0-9]+$')) {
matches = matches.concat([[encryptedPhoneNum1, encryptedPhoneNum2]]);
}
}
* Download Atom Editor and install it
* Go to packages to install a package and install
- git-plus
- last-cursor-position
- line-diff-details
- linter
- linter-eslint
- merge-conflicts
- preview
/ )( \
) __ (
\_)(_/
__
/ _\
/ \
\_/\_/
____
( _ \
) __/