Skip to content

Instantly share code, notes, and snippets.

View alphapapa's full-sized avatar

Adam Porter alphapapa

  • USA
View GitHub Profile
@0XDE57
0XDE57 / config.md
Last active April 18, 2024 04:36
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@jordonbiondo
jordonbiondo / dll-fifo.el
Created December 30, 2015 15:17
A fifo queue in emacs lisp using a cyclic doubly linked list.
;; FIFO queue implementation using cyclic doubly linked lists
;;
;; This data structure is a bit overkill for a queue,
;; but it has many other uses
;; a doubly linked list cell look like (val . (prev-cell next-cell))
;;
;; a FIFO queue object looks like ('fifo . cyclic-doubly-linked-list)
;;
;; An empty FIFO queue would be: ('fifo . nil)
@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
@alphapapa
alphapapa / org-agenda-subtree-or-region.el
Last active March 21, 2016 10:46
Emacs: Display org-agenda for current subtree or region
(defun org-agenda-subtree-or-region (prefix)
"Display an agenda view for the current subtree or region.
With prefix, display only TODO-keyword items."
(interactive "p")
(let (header)
(if (use-region-p)
(progn
(setq header "Region")
(put 'org-agenda-files 'org-restrict (list (buffer-file-name (current-buffer))))
(setq org-agenda-restrict (current-buffer))
@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))
@wasamasa
wasamasa / filter-buffer.el
Last active October 10, 2017 19:45
Emacs buffer filtering
(defun my-filter-current-buffer (program &rest args)
(let* ((stdout-buffer (generate-new-buffer " stdout"))
(ret (apply 'call-process-region (point-min) (point-max) program
nil (list stdout-buffer) nil args)))
(when (zerop ret)
(let ((output (with-current-buffer stdout-buffer
(buffer-string))))
(erase-buffer)
(insert output)))
(kill-buffer stdout-buffer)))
#!/usr/bin/env zsh
# -*- coding: UTF8 -*-
# Author: Guillaume Bouvier -- guillaume.bouvier@ens-cachan.org
# 2016-05-10 15:36:06 (UTC+0200)
format_duration()
{
diff=$1 # Duration in seconds
if test $diff -ge 86400; then
@wzhd
wzhd / .gitignore
Last active December 20, 2016 09:17 — forked from xiaoganghan/mynote.xml
Parsing Evernote export file (.enex) using Python
*.enex
@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 / better-org-return.el
Last active April 13, 2017 16:12
Better org-return
(defun ap/org-return (&optional ignore)
"Add new list item, heading or table row with RET.
A double return on an empty element deletes it. Use a prefix arg
to get regular RET. "
;; See https://gist.github.com/alphapapa/61c1015f7d1f0d446bc7fd652b7ec4fe and
;; http://kitchingroup.cheme.cmu.edu/blog/2017/04/09/A-better-return-in-org-mode/
(interactive "P")
(if ignore
(org-return)
(cond ((eq 'link (car (org-element-context)))