Skip to content

Instantly share code, notes, and snippets.

# completion colors
eval `dircolors`
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
# history search
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
def longest_substr(data):
supstr = data[0]
end = len(supstr)
substr = ''
for i in xrange(end):
start = i + 1 + len(substr)
if (start >= end + 1):
break
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from copy import deepcopy
from operator import or_
import re
import hoep as h
@uhnomoli
uhnomoli / attr_list.py
Created August 20, 2013 22:13
Enables attribute list support for lists in Python Markdown.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from markdown.extensions import Extension
from markdown.extensions.attr_list import AttrListTreeprocessor as _AttrListTreeprocessor, isheader
from markdown.util import isBlockLevel
@uhnomoli
uhnomoli / categories.diff
Last active December 17, 2015 22:39
Adds category support to mynt.
diff --git a/mynt/core.py b/mynt/core.py
index 0cab910..d7d6778 100644
--- a/mynt/core.py
+++ b/mynt/core.py
@@ -38,6 +38,8 @@ class Mynt(object):
'archives_url': '/',
'assets_url': '/assets/',
'base_url': '/',
+ 'category_layout': None,
+ 'categories_url': '/',
--- /home/andrew/dev/www/wp/wp-content/plugins/eshop/authorizenet.php.old
+++ /home/andrew/dev/www/wp/wp-content/plugins/eshop/authorizenet.php
@@ -125,12 +125,10 @@
//goes direct to this script as nothing needs showing on screen.
if($eshopoptions['cart_success']!=''){
$ilink=add_query_arg('eshopaction','authorizenetipn',get_permalink($eshopoptions['cart_success']));
+ $p->add_field('x_relay_url', $ilink);
}else{
die('<p>'.$derror.'</p>');
}
'''
[CREDITS]
authors:
adzenith (https://github.com/adzenith)
ajpalkovic (https://github.com/ajpalkovic)
Anomareh (https://github.com/Anomareh)
url:
https://gist.github.com/1136448
[OPTIONS]
@uhnomoli
uhnomoli / subl-upd
Created March 30, 2011 10:56
A Sublime Text 2 update script for Linux.
#!/bin/sh
file="Sublime Text 2 Build ${1} x64.tar.bz2"
# Uncomment line below for 32 bit.
#file="Sublime Text 2 Build ${1}.tar.bz2"
url="http://www.sublimetext.com/${file}"
first=0
if [ $(id -u) -ne 0 ]
then
<?php
/**
* purifierConfig is an HTMLPurifier config handler.
*
* It manages HTMLPurifier configs.
*
*
* Accepts an array of configs at initialization resembling something like:
*