Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Eat Sleep Code Repeat

Frank Hassanabad FrankHassanabad

🎧
Eat Sleep Code Repeat
View GitHub Profile
View gist:95f3886260c02b89ca84
//On the page http://bost.ocks.org/mike/circles/
//This will change the first set of circles as an example of
//how all of that works. Paste this into your chrome console
//when on that page and then execute changeFirstCircles([4, 4, 4])
//or any other numbers you want.
var chanageFirstCircles = function(newDataSet)
{
// Generic function that binds the data
var f = function(d) { return d; }
View README.md
View Google public certs JWK and PEM
Certs:
https://www.googleapis.com/oauth2/v3/certs
PEM:
https://www.googleapis.com/oauth2/v1/certs
View gist:f5f1a822c0a205f8b060
/ )( \
) __ (
\_)(_/
__
/ _\
/ \
\_/\_/
____
( _ \
) __/
View gist:9e935d4e518ddc69f9c5
* 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
View Testing Gist
This is my test Gist.
View crib-phone-example.js
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]]);
}
}
View crib-phone-example-2.js
encryptedPhoneNumbers.forEach((encryptedPhoneNumber) => {
const xor = xorStrings(encryptedPhoneNumber, exactMatch);
const output = xorPlainTextWithCrib(xor, inputPhoneNum);
printPlain(output);
});
@FrankHassanabad
FrankHassanabad / openssl_example.sh
Created Mar 17, 2018
Openssl key generation example
View openssl_example.sh
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: ****************
View mdn_crypto.js
/* 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]);
}