Skip to content

Instantly share code, notes, and snippets.

@vedang
vedang / hey_notmuch!
Last active March 29, 2024 17:48
Notmuch configuration for Hey.com Style workflows.
- Specific Notmuch filters (and saved-searches) for:
+ The Feed (newsletters, blogs)
+ The Paper trail (receipts, ledger)
+ Screened Inbox (mail from folks you actually want to read)
+ Previously Seen (important mail that you've already read)
+ Unscreened Inbox (potential spam / stuff you don't want)
- Elisp Functions to move / categorize emails from a particular sender.
+ Adds tags needed by filters defined above to all email sent by a particular sender
+ Creates an entry in a DB file, which is used by the Notmuch post-new script when indexing new email, to auto-add the relevant tags.
@wolever
wolever / git-unpull
Last active December 21, 2015 04:08
git-unpull: undoes the merge commit created by an accidental 'git pull', plus some added helpful information!
#!/bin/bash
# Reverts HEAD back to ORIG_HEAD, for example after a 'git pull' accidentally
# creates a merge. This is identical to running 'git reset --hard ORIG_HEAD',
# except that unpull prints some helpful information along the way.
# Useage:
# $ git unpull
# HEAD: a0ac0fd Merge branch 'master' of /tmp/foo
# 2284c9d some remote commit
# ORIG_HEAD: 35431fd my local commit
# Really reset HEAD to ORIG_HEAD? (y/n) y
@wolever
wolever / README.md
Last active August 16, 2019 13:42
Tools for creating an x509 certificate authority and using it to create and sign certificates.
@davisagli
davisagli / gist:2317969
Created April 6, 2012 07:42
Marmoset patching
import inspect
def marmoset_patch(func, s, r):
source = inspect.getsource(func).replace(s, r)
exec source in func.func_globals
func.func_code = func.func_globals[func.__name__].func_code
def foo():
print 1
print 2
@wolever
wolever / example.py
Created February 18, 2012 06:31
A persistent Queue implementation in Python which focuses on durability over throughput
from pqueue import PersistentQueue
q1 = PersistentQueue("/tmp/queue_storage_dir")
q1.put("1")
q1.put("2")
q1.put("3")
q1.close()
q2 = PersistentQueue("/tmp/queue_storage_dir")
while not q2.empty():