Skip to content

Instantly share code, notes, and snippets.

View lincetto's full-sized avatar

Andrea Lincetto lincetto

View GitHub Profile
@lincetto
lincetto / split.sh
Created June 15, 2020 12:55
Split multiple PDF files in linux using qpdf
#!/bin/bash
function process() {
echo "Processing $file"
totpages=`qpdf --show-npages "$file"`
echo "Processing $file : tot pages -> $totpages"
numsplit=$((totpages/2))
echo "Processing $file : tot splitted files -> $numsplit"
for currsplit in $(seq 1 $numsplit);
do
echo "Exporting pages $(((currsplit-1)*2+1))-$((currsplit*2)) from $file"
@lincetto
lincetto / remove_from_cache
Last active November 15, 2021 16:15 — forked from imevro/gist:edfe9dea12196056467f
Clean up all cached pages in prerender.io from console using a search term
(async () => {
await import('https://code.jquery.com/jquery-2.2.4.min.js')
// Library ready
var cleanUp = function() {
jQuery.ajax({method: "GET", url: "https://dashboard.prerender.io/api/cached-pages?page=0&pageSize=1000&sort=date"}).success(function(response) {
var total = response,
lastChecked = 1;
console.log("total: " + response.length);