Skip to content

Instantly share code, notes, and snippets.

View alphapapa's full-sized avatar

Adam Porter alphapapa

  • USA
View GitHub Profile
@mskorzhinskiy
mskorzhinskiy / org-ql-rasmi.el
Created December 18, 2020 09:15
Current configuration for personal org queries
(setq
org-ql-views
'(("stuck" lambda nil
(interactive)
(org-ql-search
(org-agenda-files)
'(and (tags "story")
(not (tags "ignore"))
(not (done)) ;; Finished stories should be excluded
(not (descendants (todo "NEXT"))) ;; If there are already
@alphapapa
alphapapa / helm-org-tag-completion.el
Last active December 21, 2022 15:45
Complete multiple org-mode tags with helm
;;;;;; Fix Helm org tag completion
;; From Anders Johansson <https://groups.google.com/d/msg/emacs-helm/tA6cn6TUdRY/G1S3TIdzBwAJ>
;; This works great! He posted it on 3 Mar 2016, on a thread that was
;; started in Oct 2013. He also posted this message on 2 Apr 2014,
;; maybe an earlier attempt at a solution:
;; <http://article.gmane.org/gmane.emacs.orgmode/84495> I've just
;; tidied it up a bit and adjusted the prompt.
(add-to-list 'helm-completing-read-handlers-alist '(org-capture . aj/org-completing-read-tags))
@alphapapa
alphapapa / elfeed-config.el
Created September 13, 2018 10:41
Elfeed config
;;; elfeed configuration
(use-package elfeed
;;;; Keymaps
:general
(:keymaps '(shr-map)
"a" 'pocket-reader-shr-add-link)
(:keymaps '(elfeed-show-mode-map elfeed-search-mode-map)
@thibaudcolas
thibaudcolas / README.md
Last active January 30, 2022 05:45
Video Downloader professional kmdldgcmokdpmacblnehppgkjphcbpnn background.js

Video Downloader professional kmdldgcmokdpmacblnehppgkjphcbpnn background.js

This is the source of background.js for a now-unpublished Chrome extension called "Video Downloader professional" (ID kmdldgcmokdpmacblnehppgkjphcbpnn, since then replaced with another "Video Downloader professional" (ID bacakpdjpomjaelpkpkabmedhkoongbi). This script is republished here for educational / research purposes. It has initially been extracted from the extension’s archive available as v2.4 on https://www.crx4chrome.com/.

Why is this interesting?

The extension has appeared in malware discussions in the past. Its replacement of Video downloader professional "bacakpdjpomjaelpkpkabmedhkoongbi" seems related to the [ownership change of The Great Suspender](greatsuspender/thegreatsuspender#1263 (comment)

@alphapapa
alphapapa / Firefox-Gtk2-build-1.patch
Last active January 26, 2022 03:05
Patch Firefox 49.0.2 to build with Gtk2
This 1) adjusts the Mozilla mozconfig.gtk file according
to the comments in it, and 2) removes a directory from
the debian/firefox.install.in file that comes up empty
when building with Gtk2, which then causes the package
build to fail due to trying to include files from an
empty directory (don't ask me why the gtk2 directory
is empty when built with Gtk2).
---
build/unix/mozconfig.gtk | 25 +------------------------
debian/firefox.install.in | 1 -
@alphapapa
alphapapa / org-kbd.el
Created December 16, 2018 10:24
Org mode: Add syntax to export HTML KBD elements
;;; org-kbd
;; (setq org-emphasis-alist '(("%" org-kbd verbatim)
;; ("*" bold)
;; ("/" italic)
;; ("_" underline)
;; ("=" org-verbatim verbatim)
;; ("~" org-code verbatim)
;; ("+"
;; (:strike-through t))))
@felipeochoa
felipeochoa / pp-debug.el
Last active November 19, 2021 19:59
Pretty print emacs debug frames
;;; pp-debug.el --- Pretty-printing debugger -*- lexical-binding: t -*-
;; Copyright (C) 2018 Felipe Ochoa
;; Author: Felipe Ochoa
;; Created: 5 Dec 2017
;; License: GPLv3
;;; Commentary:
;;; Pretty-print debugger frames.
@alphapapa
alphapapa / replace-words-randomly.el
Created July 24, 2017 22:40
Emacs: Replace all words in buffer with random words of the same length
;; This function replaces all words in a buffer with words of the same length,
;; chosen at random from /usr/share/dict/words. Words are replaced consistently,
;; so e.g. "A" is always replaced with "Z". The mapping changes when Emacs is
;; restarted or when the cache buffer is killed. If all unique words of a certain
;; length are exhausted, random strings are used.
(defun ap/replace-words-randomly (&optional buffer)
"Replace all words in BUFFER or current buffer with randomly selected words from the dictionary.
Every time a new word is found, it is mapped to a replacement
word, so every instance of word A will be replaced with word Z."
@jscheid
jscheid / .dockerignore
Last active July 9, 2021 11:10
Running makem in Docker
Dockerfile
/.sandbox/
/.git/
@alphapapa
alphapapa / mangle
Last active June 21, 2021 16:03
Mangle man pages to show just the parts you need (suitable for aliasing to "man")
#!/bin/bash
less_command='| less $less_no_init -aiF -Ps"Manual page\: $man_page (?ltline %lt?L/%L.:byte %bB?s/%s..? (END):?pB %pB\%..)"'
# Get section
if [[ $1 =~ [0-9]+ ]]
then
section=$1
shift
fi