Skip to content

Instantly share code, notes, and snippets.

View rafa-br34's full-sized avatar
🔴
Procrastinating...

rafa_br34 rafa-br34

🔴
Procrastinating...
View GitHub Profile
@rafa-br34
rafa-br34 / Benchmark.cpp
Last active January 9, 2024 16:51
A C++17 benchmark to test branched vs branchless performance.
// Compile with
// g++ -O3 -Ofast -m64 -lstdc++ -std=c++17 Benchmark.cpp -o Benchmark
#include <iostream>
#include <cstring>
#include <vector>
#include <thread>
#include <random>
#include <chrono>
#include <atomic>
@rafa-br34
rafa-br34 / PixiesetDownloader.js
Created September 12, 2023 02:06
Downloader for pixieset
var s = "["
for (let ImageElement of document.getElementsByTagName("img")) {
if (ImageElement.getAttribute("id")) {
let str = ImageElement.getAttribute("src")
s += `'${str.substr(2, str.length)}',`
}
}
s += "]"
c = `import shutil, requests\\ns=${s}\\ni=0\\nfor u in s:\\n\\tb = requests.get('https://'+(u.replace('-large.','-xxlarge.')), stream=True)\\n\\twith open(str(i)+'.png','wb') as f:\\n\\t\\tshutil.copyfileobj(b.raw,f)\\n\\t\\ti+=1`
console.log(`python -c "exec(\\"${c}\\")"`)