This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Intercept and check keydown events for Ctrl+Shift+C */ | |
document.body.addEventListener('keydown', function(evt){ | |
if (evt.ctrlKey && evt.shiftKey && evt.key == "C"){ | |
// Copy the selection to the clipboard | |
document.execCommand('copy'); | |
// Throw away this event and don't do the default stuff | |
evt.stopPropagation(); | |
evt.preventDefault(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: application/json'); | |
$DATA = new stdClass(); | |
$DATA->http_referer = $_SERVER['HTTP_REFERER']; | |
/** | |
* Only allow access to this script via ajax requests from this same server | |
* if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) !== 'xmlhttprequest' ){ | |
* $DATA->message = "Not an ajax request"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo du -hsx --exclude=/{proc,sys,dev,run} /*| sort -hr | head -n20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /usr/share/i18n/locales/la_VA | |
# PASTE contents from https://sourceware.org/bugzilla/attachment.cgi?id=13866 | |
sudo nano /usr/share/i18n/SUPPORTED | |
# add 'la_VA.UTF-8 UTF-8' to the list | |
sudo locale-gen la_VA.UTF-8 | |
LC_TIME=la_VA.UTF-8 date | |
# should output something like: | |
# Fer VI 18 Feb 2022, 12:35:36 CET | |
LC_TIME=la_VA.UTF-8 date +"%A %-d %B %Y, %T %Z" | |
# should output something like: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="it"> | |
<head> | |
<title>Medjugorje</title> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" name="viewport"> | |
<meta content="IE=edge" http-equiv="X-UA-Compatible"> | |
<meta name="pdfkit-page-size" content="A4"/> | |
<meta name="pdfkit-orientation" content="Portrait"/> | |
<meta name="pdfkit-dpi" content="300"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ | |
html { | |
font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; | |
-ms-text-size-adjust:100%; | |
-webkit-text-size-adjust:100%; | |
position:relative; | |
} | |
body { | |
margin:0; | |
padding: 36px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import make_response, Flask | |
import pdfkit | |
import os | |
path_wkhtmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' | |
config = pdfkit.configuration(wkhtmltopdf=path_wkhtmltopdf) | |
pdfoptions = { | |
"print-media-type": None, | |
"page-size": "A4", | |
"dpi": "300", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let liturgyToday = {}; | |
$.getJSON('https://www.johnromanodorazio.com/LiturgicalCalendar/LitCalEngine.php?diocesanpreset=DIOCESIDIROMA',function(data){ | |
for(const [key,entry] of Object.entries(data.LitCal)){ | |
let entryDate = new Date(entry.date * 1000); | |
if(entryDate.getUTCMonth() == new Date().getMonth() && entryDate.getUTCDate() == new Date().getDate()){ | |
liturgyToday[key] = entry; | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var data = { | |
'action': 'call_litcal_api', | |
'nationalpreset': 'USA' | |
}; | |
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php | |
jQuery.get(ajaxurl, data, function(response) { | |
alert('Got this from the LitCal API: ' + response); |