Skip to content

Instantly share code, notes, and snippets.

@slackorama
slackorama / .zshrc
Last active Aug 29, 2015
Sample .zshrc to get auto-fu.zsh working.
View .zshrc
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 Aug 29, 2015
Sensible osx defaults
View .osx
#!/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 &
View init.el
(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 Aug 29, 2015
Config for bug-reference-url and JIRA
View bug-reference-jira.el
(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 Nov 26, 2014
Export Chrome search engines to use in firefox.
View migrate_search_engines.py
#!/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
View gen-rtm.py
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 Aug 29, 2015
Output JIRA tickets in an org file
View jira.org

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'
View tidybz2.user.js
// ==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 Dec 4, 2008
How to use dojox.lang.aspect tracer in dojo 1.2
View gist:32051
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 Dec 9, 2008
Deleting an item from a datastore in dojo 1.2
View deletefromstore.js
store.fetchItemByIdentity( { identity: id,
onItem: function(item){
store.deleteItem( item );
}
});