This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cached(key_formatstr): | |
def decorator(fn): | |
def wrapped(self, *args, **kwargs): | |
cache_key = key_formatstr.format(*args, **kwargs) | |
log.debug('Fetching cached value for {0}'.format(cache_key)) | |
value = self.mc_get(cache_key) | |
if not value: | |
value = fn(self, *args, **kwargs) | |
log.debug('Storing cached value for {0}'.format(cache_key)) | |
self.mc_set(cache_key, value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class KeyError extends Exception {}; | |
function filter_tree($tree, $fields) { | |
if (empty($fields)) | |
{ | |
return $tree; | |
} | |
$result = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import argparse | |
from itertools import ifilter | |
from fuzzywuzzy import fuzz | |
MATCH_THRESHOLD = 90 | |
def parse_file(filename, predicate=None): | |
with open(filename) as f: | |
return aggregate_errors(f, predicate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; ox-confluence-en.el --- Enhanced Confluence Wiki Back-End for Org Export Engine | |
;; Copyright (C) 2015, Correl Roush | |
;; Author: Correl Roush <[email protected]> | |
;; Keywords: outlines, confluence, wiki | |
;; This file is not part of GNU Emacs. | |
;; This program is free software: you can redistribute it and/or modify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#+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)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
OlderNewer