::Digest::SHA256.hexdigest
echo 'hello'|md5
b1946ac92492d2347c6235b4d2611184
class Array | |
def bubble_sort! | |
sorted = false | |
while !sorted | |
sorted = true | |
(0...self.length - 1).each do |index| | |
comparison = if block_given? | |
yield self[index], self[index+1] | |
else | |
self[index] > self[index + 1] |
<!-- https://pretagteam.com/question/html5-display-audio-currenttime --> | |
<div> | |
<audio id="track" src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3" ontimeupdate="document.getElementById('tracktime').innerHTML = this.currentTime.toFixed(2) + ' / ' + this.duration.toFixed(2);" controls="controls"> | |
<p>Your browser does not support the audio element</p> | |
</audio> | |
<span id="tracktime">0 / 0</span> | |
</div> | |
<div> |
#!/usr/bin/perl | |
#Filename: FlashVideoCapture.pl | |
use strict; | |
################################################## | |
# Setup the variables | |
################################################## | |
my $PROGNAME = $0; $PROGNAME =~ s|.*/||; | |
my $LSOF = 'lsof'; |
.tracks[]|"wget `curl -H 'appvers: 1.0.15.10102924' -H 'baseapi: 23' -H 'basever: 1.0.15.10102924' -H 'beta: 0' -H 'channel: 0' -H 'channelid: 0' -H 'osver: 10.0.1' -H 'skey: pZw4DtHy' -H 'user-agent: Whear/1.0.15 WHBrand/xiaomi Dalvid/2.1.0 (Linux; U; Android 10.0.1; Redmi Note 8 Build/MRA58K)' -H 'vid: 2319074' -H 'wrts_listentime: 0' -H 'wrts_signature: 1623431083_1621078395_eeabecbf444e0e50fcdb7f' 'https://i.at.qq.com/getplayinfo?trackId=" + .trackId + "&type=0&model='|jq -r '.url'` -O " + .title + ".m4a" |
send_email() { | |
# sendgrid api key | |
API_KEY=$mykey | |
to=$1 | |
from=$2 | |
subject=$3 | |
content=$4 | |
JSON_FORMAT='{"personalizations": [{"to": [{"email": "%s"}]}],"from": {"email": "%s"},"subject": "%s","content": [{"type": "text/plain", "value": "%s"}]}\n' | |
data=$(printf "$JSON_FMT" "$to" "$from" "$subject" "$content") | |
curl --request POST \ |
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | |
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \ | |
apt-get -yq update && apt-get -yq install google-chrome-stable | |
CHROMEDRIVER_VERSION=$(curl -s http://chromedriver.storage.googleapis.com/LATEST_RELEASE) && \ | |
cd /tmp/ && curl -L -O "http://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" && \ | |
unzip chromedriver_linux64.zip && chmod +x chromedriver && mv chromedriver /usr/bin |
bundle exec rake zeitwerk:check
load_defaults "6.0 # use zeitwerk
config.autoloader = :classic # not use zeitwerk