Skip to content

Instantly share code, notes, and snippets.

@correl
correl / requirements.txt
Created August 27, 2020 22:29
Turntable record detection using audio fingerprinting via PyDejavu
git+https://github.com/worldveil/dejavu.git#egg=PyDejavu
pyalsaaudio
requests
@correl
correl / honk.el
Last active November 8, 2019 20:52
Honk
;;; honk.el --- Bad Goose -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2019, Correl Roush
;; Author: Correl Roush <correl@gmail.com>
;; URL: https://gist.github.com/correl/13047d283688ea408acc5c62270b0bfd
;; Version: 1.0
;; Keywords: honk, goose
;; Package-Requires: (emms)
;; This file is not part of GNU Emacs.
from __future__ import print_function
from owotrans import owo
try:
import __builtin__
except ImportError:
# Python 3
import builtins as __builtin__
#!/usr/bin/env python2.7
""" Outputs JIRA issue information for each issue id
"""
from urllib import urlencode
import argparse
import base64
import json
import os
@correl
correl / months.org.txt
Last active June 18, 2018 15:28
Month difference in an org table
#+BEGIN_SRC emacs-lisp
(defun months-diff (a b)
(let* ((date-a (mapcar #'string-to-number (split-string a "-")))
(date-b (mapcar #'string-to-number (split-string b "-")))
(months-a (+ (* 12 (car date-a)) (cadr date-a)))
(months-b (+ (* 12 (car date-a)) (cadr date-b))))
(+
(- months-a months-b)
(if (< (caddr date-a) (caddr date-b)) -1 0))))
@correl
correl / journal.org.txt
Created June 11, 2018 18:16
Graphing gender expression in my org-mode journal
* Graphs
** Gender Expression
#+name: mtf
#+BEGIN_SRC emacs-lisp :exports none :results silent
(->>
(org-map-entries
(lambda ()
(list (car (s-split " " (org-no-properties (org-get-heading t t t t))))
(--if-let (org-entry-get (point) "MTF")
(string-to-number it))
@correl
correl / recursiveitemgetter.py
Last active April 12, 2017 14:59
Recursively accessing dictionaries and sorting a list of nested data structures
from functools import partial
def recursiveitemgetter(keys):
"""Returns a function that recursively fetches a value from a
dictionary, where keys is a list of keys to traverse."""
def recursive_get(keys, dictionary):
"""Recursively fetches a value from a dictionary, where keys is a
list of keys to traverse."""
;;; ox-confluence-en.el --- Enhanced Confluence Wiki Back-End for Org Export Engine
;; Copyright (C) 2015, Correl Roush
;; Author: Correl Roush <correl@gmail.com>
;; Keywords: outlines, confluence, wiki
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
@correl
correl / org-capture.el
Created March 2, 2015 16:38
Org-Capture templates
(setq org-capture-templates
'(("j" "Journal Entry" plain
(file+datetree "~/org/journal.org")
"%U\n\n%?" :empty-lines-before 1)
("b" "Bookmark" entry
(file+headline "~/org/bookmarks.org" "Unsorted")
"* %^{Title}\n\n Source: %u, %c\n\n %i")
("w" "Log Work Task" entry
(file+datetree "~/org/coredial/worklog.org")
"* TODO %^{Description} %^g\n%?\n\nAdded: %U"
@correl
correl / taffybar.hs
Last active October 3, 2016 18:53
Xmonad Configuration
import System.Taffybar
import System.Taffybar.Systray
import System.Taffybar.TaffyPager
import System.Taffybar.SimpleClock
import System.Taffybar.Widgets.PollingGraph
import System.Taffybar.Widgets.PollingBar
import System.Taffybar.Weather
import System.Taffybar.FreedesktopNotifications
import System.Taffybar.Battery
import System.Information.CPU