Skip to content

Instantly share code, notes, and snippets.

@slackorama
slackorama / jira.org
Last active August 29, 2015 14:14
Output JIRA tickets in an org file

Functions

This is just a org-babel block that gets the tickets. You’ll need jira-python installed.

from jira.client import GreenHopper

gh = GreenHopper({
    'server': 'https://yourjira.atlassian.net'
import datetime
"""
Generate a list of tasks to import into RTM that map out the tiered
contribution of money each week. At the end of the year, you should have
$2756.
After you run this, copy the output and send it to your RTM import email
address with the subject "Daily"
"""
@slackorama
slackorama / migrate_search_engines.py
Created November 26, 2014 22:04
Export Chrome search engines to use in firefox.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Grab the search engines from Chrome and try to put them into a format that
Firefox can import so you have the same keywords to use there.
Only works on Linux right now. And with the Default profile. So yeah...
"""
import sqlite3
@slackorama
slackorama / bug-reference-jira.el
Last active August 29, 2015 14:07
Config for bug-reference-url and JIRA
(setq bug-reference-url-format "ecjira.atlassian.net/browse/%s")
(setq bug-reference-bug-regexp "\\(\\)\\([A-Z]+-[0-9]+\\)")
(defun endless/ispell-word-then-abbrev (p)
"Call `ispell-word'. Then create an abbrev for the correction made.
With prefix P, create local abbrev. Otherwise it will be global."
(interactive "P")
(let ((bef (downcase (or (car (ispell-get-word nil)) ""))) aft)
(call-interactively 'ispell-word)
(setq aft (downcase (or (thing-at-point 'word) "")))
(unless (or (string= aft bef) (string= bef ""))
(message "\"%s\" now expands to \"%s\" %sally"
bef aft (if p "loc" "glob"))
@slackorama
slackorama / .osx
Last active August 29, 2015 14:03
Sensible osx defaults
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@slackorama
slackorama / .zshrc
Last active August 29, 2015 14:02
Sample .zshrc to get auto-fu.zsh working.
autoload -Uz compinit; compinit
source $HOME/Downloads/auto-fu.zsh/auto-fu.zsh
zle-line-init () auto-fu-init; zle -N zle-line-init
@slackorama
slackorama / svn-skel.py
Last active February 2, 2016 18:16
Recursively checkout a directory tree (and just the directories) w/svn
#!/usr/bin/env python
"""
Recursively checkout a directory tree (and just the directories)
"""
import subprocess
import sys
import os
# Base 36 functions: useful for generating compact URLs
def decode(s):
"""
Converts a base 36 string to an ``int``. Raises ``ValueError` if the
input won't fit into an int.
"""
# To prevent overconsumption of server resources, reject any
# base36 string that is long than 13 base36 digits (13 digits
# is sufficient to base36-encode any 64-bit integer)
import zlib
import sys
import subprocess
import tempfile
d = zlib.decompressobj(16+zlib.MAX_WBITS)
def bob(data):
for value in data:
print(value)