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 idea is to load a placeholder popup right after the click | |
// and then redirect it later to the real location. | |
// on click | |
let popup = showPlaceholderPopup('Loading...'); | |
api.get('/obtain-the-real-url').then(url => { | |
popup.location.href = url; | |
}); |
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
host_public_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip | |
setup_ssh = <<SCRIPT | |
mkdir -p /home/ubuntu/.ssh | |
echo '#{host_public_key}' >> /home/ubuntu/.ssh/authorized_keys | |
SCRIPT | |
install_python = 'DEBIAN_FRONTEND=noninteractive apt-get install -y python' | |
Vagrant.configure('2') do |config| |
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 | |
if [ ! -d ".env" ]; then | |
virtualenv -p `which python3` .env | |
fi | |
source .env/bin/activate |
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
Whisker menu > Keyboard > Application Shortcuts > Add | |
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause |
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
// Talking console | |
// | |
// Support: http://caniuse.com/#search=SpeechSynthesisUtterance | |
// | |
// Copy paste the code into dev console or | |
// use http://mrcoles.com/bookmarklet/ to create a bookmarklet. | |
/* ✂️ ......................................................................................... */ | |
if(console.log.name !== 'talkLog') { | |
console.l = console.log; |
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
/* | |
Hampel Filter implemented in JavaScript by Adam O'Grady | |
AN: Very basic (ie: improve before using in production) function I needed for some work stuff, used for detecting and removing outliers in a moving window via Median Absolute Deviation (MAD) | |
PARAMS: | |
data - Array of numbers to be examined | |
half_window: Integer representing half the moving window size to use | |
threshold: Integer for the maximum multiple of the Median Absolute Deviation before it's considered an outlier and replaced with the median | |
RETURNS: | |
object: | |
data: updated, smoothed array |
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
For symmetic encryption, you can use the following: | |
To encrypt: | |
openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt | |
To decrypt: | |
openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt | |
For Asymmetric encryption you must first generate your private key and extract the public key. |