When
$$ \sqrt[3]{\sum_{i=1}^{\infty}}
from pathlib import Path | |
import pickle | |
import hmac | |
path = Path(__file__).parent | |
def run(): | |
secret_key = b"@SECRET@" | |
data = {'seed': 42} |
set var to "Do you want to point your DNS to Google servers?" | |
set question to display dialog var buttons {"Update DNS", "Quit"} giving up after 5 | |
set answer to button returned of question | |
if answer is "Update DNS" then | |
do shell script "networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4" with administrator privileges | |
delay 3 | |
do shell script "dscacheutil -flushcache" with administrator privileges |
When
$$ \sqrt[3]{\sum_{i=1}^{\infty}}
function modulus(xs) { | |
let output = []; | |
while (true) { | |
if (xs.length) { | |
let [a, b] = [xs.shift(), xs.shift()]; | |
if (b > a) output.push(a); | |
else { | |
let c = b; | |
while (true) { | |
let d = a - c; |
function *fibonocci(t) { | |
let a = 1, b = 0, c = 0; | |
while(c < t) { | |
yield c; | |
c = a + b; | |
a = b; b = c; | |
} | |
} | |
let output = Array.from(fibonocci(21), n => n * 2); |
#!/bin/bash | |
while :; do | |
for c in 🌕 🌖 🌗 🌘 🌑 🌑 🌑 🌒 🌓 🌔 🌕;do | |
echo -en "\r" "$c" | |
sleep 0.1 | |
done | |
done |
#!/bin/bash | |
tput reset | |
icon=("|" "/" "-" "\\") | |
for n in {1..100} | |
do | |
tput cup 0 0 | |
echo "${icon[n%4]}" |
#!/bin/bash | |
tput reset | |
for n in {1..100} | |
do | |
tput cup 0 0 | |
echo $n | |
sleep 0.01 | |
done |
#!/bin/bash -e | |
usage() { echo "tarch file"; } | |
if [[ -z $1 ]]; then usage; exit 1; fi | |
total=$(tar cf - "$1" | wc -c) | |
gzip=$(tar czf - "$1" | wc -c) | |
bzip2=$(tar cjf - "$1" | wc -c) | |
gzip_goal=$(echo "scale=2; ${gzip} / ${total} * 100" | bc) |
function perm1(input /* string */) { | |
if (!input.length) return [input]; | |
let results = input.split('').reduce((results, c) => { | |
let tail = input.split(c).join(''); | |
return results.concat(perm1(tail).map(p => c + p)); | |
}, []); | |
return results; | |
} |