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
[ | |
"Dasher", | |
"Dancer", | |
"Prancer", | |
"Vixen", | |
"Comet", | |
"Cupid", | |
"Donner", | |
"Bliksem", | |
"Rudolph" |
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
const { | |
randomFill | |
} = require('crypto') | |
const dirtyNonce = {} | |
const _nonce = () => { | |
const buf = Buffer.alloc(16) | |
return new Promise((resolve, reject) => { | |
randomFill(buf, (err, buf) => { |
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
sudo adduser $NEW_USER | |
sudo usermod -aG sudo $NEW_USER |
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
echo "What is your new username?" | |
read $USER | |
# Close putty and connect again this time with the following credentials | |
# Username: root | |
# Password: <new password you created> | |
# Now we will change the pi username to something different, replace $NAME with whatever you pick | |
sudo usermod -l $NAME -d /home/$NAME -m pi | |
sudo chown $NAME /home/$NAME | |
# Close putty and connect again this time with your new username |
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/sh | |
echo "empty ~/.Trash" | |
rm -rf ~/.Trash/* | |
echo "Secure Erase Freespace /dev/disk1" | |
diskutil secureErase freespace 2 /dev/disk1 |
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 { statSync } from 'fs' | |
import { spawnSync } from 'child_process' | |
/** | |
* Does file exist. | |
* | |
* @public | |
* @param {string} filePath Path to file. | |
* @return {boolean} File is found. <true> |
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
// get Unicode values of character items in an array | |
function getCharactersUnicodeValue(characters) { | |
const unicodeChart = new Map(); | |
characters.forEach(character => { | |
unicodeChart.set( | |
character, | |
character.charCodeAt(character.indexOf(character)) | |
); | |
}); | |
console.table(unicodeChart); |
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
const hexGenerator = function(length = 16) { | |
let text = ""; | |
const possible = "ABCDEFabcdef0123456789"; | |
for(let i = 0; i < length; i++) { | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} | |
return text; | |
} | |
// convert to random with parseInt(`0x${hexGenerator()}`, 16) |
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
<html> | |
<head> | |
<!-- Polyfills only needed for Firefox and Edge. --> | |
<script src="https://unpkg.com/@webcomponents/webcomponentsjs@next/webcomponents-loader.js"></script> | |
</head> | |
<body> | |
<!-- Works only on browsers that support Javascript modules like | |
Chrome, Safari, Firefox 60, Edge 17 --> | |
<script type="module"> | |
import { LitElement, html } from 'https://unpkg.com/@polymer/lit-element@latest/lit-element.js?module'; |
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
/** | |
* The Good Sort. When your object attribute [values] are shady AF. | |
* @param {any} valueA | |
* @param {any} valueB | |
* @param {Boolean} descending - True for descending. Default is [false] ascending. | |
*/ | |
export default function sortJawn (valueA, valueB, descending = false) { | |
// the same... carry on | |
if (valueA === valueB) { | |
return 0 |