Skip to content

Instantly share code, notes, and snippets.

View jsrjenkins's full-sized avatar

Fr. John Jenkins jsrjenkins

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jsrjenkins on github.
  • I am jsrjenkins (https://keybase.io/jsrjenkins) on keybase.
  • I have a public key whose fingerprint is 5819 13A5 883D 53F7 6D64 6BEF 533B FBFF 7A42 6CB7

To claim this, I am signing this object:

@jsrjenkins
jsrjenkins / ublock.js
Created April 8, 2016 06:57
ublock in new buffer
interactive(
"ublock", "Open uBlock dashboard in a new buffer",
function (I) {
var ublock_branch;
if ("@ublock0/content-policy;1" in Cc) {
ublock_branch = "ublock0";
} else if ("@ublock/content-policy;1" in Cc) {
ublock_branch = "ublock";
} else {
throw interactive_error("uBlock not found");
@jsrjenkins
jsrjenkins / tinyurl.js
Created May 20, 2016 15:51
Make a tiny url from the current page.
// TinyURL
// This will create a browser object and allow to create a tiny URL
// for the current page and put it on the clipboard.
define_browser_object_class(
"tinyurl", "Get a tinyurl for the current page",
function (I, prompt) {
check_buffer(I.buffer, content_buffer);
let createurl = 'http://tinyurl.com/api-create.php?url=' +
@jsrjenkins
jsrjenkins / capture-conkeror.el
Last active July 28, 2023 06:18
Org Capture for Conkeror
;; place this snippit in your .init.el or with your the other
;; org-capture templates to capture web pages.
(setq org-capture-templates
'(("w" "Web Notes" entry ;; 'w' for 'org-protocol'
file+headline "~/org/notes.org" "WWW")
"* %^{Title}\n\n Source: %u, %c\n\n %i") ))
(eval-after-load
"latex"
'(TeX-add-style-hook
"cleveref"
(lambda ()
(if (boundp 'reftex-ref-style-alist)
(add-to-list
'reftex-ref-style-alist
'("Cleveref" "cleveref"
(("\\cref" ?c) ("\\Cref" ?C) ("\\cpageref" ?d) ("\\Cpageref" ?D)))))
@jsrjenkins
jsrjenkins / attach.el
Last active May 17, 2017 07:18 — forked from philjackson/attach.el
From an mu4e view, without prompt, save all attachments to a directory and open dired.
(defvar bulk-saved-attachments-dir (expand-file-name "~/Documents/Attachments"))
(defun cleanse-subject (sub)
(replace-regexp-in-string
"[^A-Z0-9]+"
"-"
(downcase sub)))
(defun view-attachments-dired (&optional msg)
"Saves all of the attachments in `msg' to a directory under
(defun my-pdf-misc-print-document (filename copies &optional interactive-p)
(interactive
(list (pdf-view-buffer-file-name) current-prefix-arg t))
(cl-check-type filename (and string file-readable))
(let ((programm (pdf-misc-print-programm interactive-p))
(args (append pdf-misc-print-programm-args
(list (concat "-# "
(if (null copies) "1"
(number-to-string copies))))
(list filename))))

Keybase proof

I hereby claim:

  • I am jsrjenkins on github.
  • I am jsrjenkins (https://keybase.io/jsrjenkins) on keybase.
  • I have a public key ASBW85o_s_qIWyaRbYv9lDbEhxcClCl0HRldQkAmvIwX4Ao

To claim this, I am signing this object:

set -exuo pipefail
LIVESTREAM_URL=$1
if [[ ! $# -eq 1 ]]; then
echo "usage: $0 <URL>"
exit 1
fi
# Referencing FFMpeg to Icecast2 Streaming Sample Gist: https://gist.github.com/keiya/c8a5cbd4fe2594ddbb3390d9cf7dcac9
URL=$(streamlink $LIVESTREAM_URL worst --stream-url)
channels=2
@jsrjenkins
jsrjenkins / get-certificate-signature.sh
Last active March 23, 2021 07:59
Obtain the server certificate for offlineimap. Takes server as first argument, optional second argument for port.
!/bin/bash
## The first argument is the server
## the second [optional] argument is the port, default is 993.
server=$1
port=${2:-993}
SSL_CERT_DIR=""
openssl s_client -connect $server:$port </dev/null 2>/dev/null | openssl x509 -fingerprint -noout -text -in /dev/stdin | grep "^SHA1 Fingerprint=" | awk -F"=" '{split($2,a," ");gsub(/"/, "", a[1]);print a[1]}' | sed 's/://g' | xclip