I hereby claim:
- I am treferwynd on github.
- I am treferwynd (https://keybase.io/treferwynd) on keybase.
- I have a public key ASDdcdpDla2VJMgV4tvy4GywvB5wke2vGvv1-Wmkm2cmxwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
(ns k_bijection) | |
; Utils: triangolize number | |
(defn triangle [x] | |
(/ (* x (+ x 1)) 2)) | |
(defn prev-pretriangle [n] | |
(int (/ (- (Math/sqrt (+ 1 (* 8 n))) 1) 2))) | |
; Bijection from N^2 to N via diagonalization, starting from 0 |
#!/bin/bash | |
## WHAT | |
# Update the resolution and turn on or off the monitors | |
IN="LVDS1" | |
EXT="HDMI1" | |
# udev stuff | |
export DISPLAY=:0 |
# Run a function multiple times and output the average time | |
runtime() { | |
quiet="" | |
if [ $1 = "-q" ]; then | |
quiet="quiet" | |
shift | |
fi | |
number=$1 | |
shift | |
tot=0 |
if [ -n "$album" ]; then | |
response="$(curl -fsSL --stderr - \ | |
-F "title=$album" \ | |
-F "sderm=orp"\ | |
-H "Authorization: Bearer $access_token" \ | |
https://api.imgur.com/3/album)" | |
if egrep -q '"success":\s*true' <<<"$response"; then # Album creation successful | |
echo "Album $album successfully created" | |
album_id="$(egrep -o '"id":\s*"[^"]+"' <<<"$response" | cut -d "\"" -f 4)" | |
del_id="$(egrep -o '"deletehash":\s*"[^"]+"' <<<"$response" | cut -d "\"" -f 4)" |