Skip to content

Instantly share code, notes, and snippets.

@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 / .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 &
(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 / 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]+\\)")
@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
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 / 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'
// ==UserScript==
// @name TidyBZ2
// @namespace http://www.sethmason.com/userscripts
// @description Provide some keyboard shortcuts and clean up the interface for
// bugzilla2 version of bugzilla.
// @include https://*/show_bug.cgi?id=*
// @include https://*process_bug.cgi*
// @author Seth Mason
// @version 0.1
// @license Creative Commons public domain (http://creativecommons.org/licenses/publicdomain/)
@slackorama
slackorama / gist:32051
Created December 4, 2008 20:17
How to use dojox.lang.aspect tracer in dojo 1.2
dojo.require('dojox.lang.aspect');
dojo.require('dojo.lang.aspect.tracer');
dojo.addOnLoad( function() {
var aop = dojox.lang.aspect;
aop.advise( yourObj,
/^((?!toString).)*$/,
new aop.tracer(true));
});
@slackorama
slackorama / deletefromstore.js
Created December 9, 2008 01:28
Deleting an item from a datastore in dojo 1.2
store.fetchItemByIdentity( { identity: id,
onItem: function(item){
store.deleteItem( item );
}
});