Skip to content

Instantly share code, notes, and snippets.

View alphapapa's full-sized avatar

Adam Porter alphapapa

  • USA
View GitHub Profile
(defun org-extra-get-properties (&rest props)
(cons (org-current-level)
(mapcar #'(lambda (prop)
(if (string= "ITEM_BY_ID" prop)
(format "[[id:%s][%s]]"
(org-entry-get (point) "ID")
(org-entry-get (point) "ITEM"))
(org-entry-get (point) prop)))
props)))
@alphapapa
alphapapa / org-ql-overview.el
Last active September 30, 2024 22:17
Org QL agenda-like overview predicates
(require 'org-ql)
(declare-function org-ql--normalize-query "org-ql" t t)
(org-ql-defpred ap:agenda (&key to)
"An agenda-like view, for use with other `ap:' predicates.
Includes tasks which with keywords:
NOW (i.e. a current task)
UNDERWAY (if not TO, or planned to TO)
NEXT (if not TO, or planned to TO)
other keywords (if scheduled to TO or within deadline warning)
(defun key-quiz--shuffle-list (list)
"Shuffles LIST randomly, modying it in-place."
(dolist (i (reverse (number-sequence 1 (1- (length list)))))
(let ((j (random (1+ i)))
(tmp (elt list i)))
(setf (elt list i) (elt list j))
(setf (elt list j) tmp)))
list)
@alphapapa
alphapapa / org-link-github.el
Last active January 22, 2024 23:38 — forked from stefanv/org-gh-links.el
GitHub links for org mode
@alphapapa
alphapapa / emacs-raise-or-run.sh
Last active August 30, 2024 14:43
Raise an Emacs window or run Emacs
#!/bin/bash
# ** Vars
# *** Emacs version
emacs="emacs"
emacsclient="emacsclient"
emacsWindowClass="Emacs"
# ** Functions
@alphapapa
alphapapa / emacs-29.1.scm
Created August 12, 2023 02:26
Guix Emacs 29.1 interim packaging
(define-module (gnu packages emacs-29.1)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix licenses)
#:use-module (gnu packages emacs)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages autotools)
#:use-module (guix utils)
#:use-module ((guix licenses) #:prefix license:)
(cl-defun ap/display-buffer-in-side-window (&optional (buffer (current-buffer)))
"Display BUFFER in dedicated side window."
(interactive)
(let ((display-buffer-mark-dedicated t))
(display-buffer-in-side-window buffer
'((side . right)
(window-parameters
(no-delete-other-windows . t))))))
@alphapapa
alphapapa / emacs-process-status-bug-ecm.el
Last active August 18, 2021 13:09
An ECM for a possible bug in Emacs's process-status code
;;; emacs-process-status-sentinel-ecm.el --- -*- lexical-binding: t; -*-
;; This file provides an ECM for a possible bug in Emacs's process
;; handling. The rub is whether a process sentinel may be called with
;; a STATUS string of "finished\n" while the process's
;; `process-status' is `open': If that is expected, then this may not
;; indicate a bug (but perhaps an issue that needs to be more
;; prominently documented). But if it's not supposed to happen, then
;; this may provide a means to reproduce the behavior and troubleshoot
;; the bug.
@alphapapa
alphapapa / .dockerignore
Created July 9, 2021 11:08 — forked from jscheid/.dockerignore
Running makem in Docker
Dockerfile
/.sandbox/
/.git/
@alphapapa
alphapapa / README.md
Created January 5, 2021 03:17 — forked from thibaudcolas/README.md
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 Download professional" (ID kmdldgcmokdpmacblnehppgkjphcbpnn, since then replaced with another "Video Download professiona" (ID bacakpdjpomjaelpkpkabmedhkoongbi). This script is republished here for educational 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.

What does t