Skip to content

Instantly share code, notes, and snippets.

👁❤️open source software …

Michael Hulse mhulse

👁❤️open source software …
Block or report user

Report or block mhulse

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mhulse /
Created Jun 17, 2011
Django basic/simple category/sub-category model.
# ...
class Category(Base):
slug = models.SlugField(_(u'slug'), max_length=100, unique=True)
title = models.CharField(_(u'title'), max_length=250)
parent = models.ForeignKey('self', blank=True, null=True, related_name='child')
class Meta:
verbose_name_plural = 'Categories'
mhulse / fromhex.bash
Last active Sep 26, 2019
Bash function to convert hex to 256 terminal color.
View fromhex.bash
# fromhex A52A2A
# fromhex "#A52A2A"
# BLUE_VIOLET=$(fromhex "#8A2BE2")
function fromhex() {
if [[ $hex == "#"* ]]; then
hex=$(echo $1 | awk '{print substr($0,2)}')
r=$(printf '0x%0.2s' "$hex")
mhulse /
Created Feb 4, 2012
[Django 1.3] Template tag that allows Django tags in variables (i.e. flatpage content).
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
mhulse / SelectActiveLayers.jsx
Last active Aug 2, 2019
Adobe Illustrator script to select highlighted layers. Written by @Qwertyfly and only slightly modified by me. Original code and discussion can found here:
View SelectActiveLayers.jsx
#target illustrator
function make() {
var name = 'temp'; // Action name.
var set = 'temp'; // Set name.
var level = app.userInteractionLevel;
var action;
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
mhulse / javascript-plugin-patterns-FOUND-protoytpe-newed.js
Last active Jun 28, 2019
Some of my favorite JavaScript plugin design patterns: The Facade Pattern, The Revealing Module Pattern, Immediately-invoked Function Expressions (IIFE)s, The Module Pattern imports and exports
View javascript-plugin-patterns-FOUND-protoytpe-newed.js
(function(window) {
'use strict';
* Extend Object helper function.
function extend(a, b) {
mhulse / Super simple background image slideshow.css
Last active Apr 14, 2019
Super simple jQuery background-image random slideshow (using CSS3 for the transition and gets the image paths via HTML5 `data` attribute).
View Super simple background image slideshow.css
[data-slides] {
background-image: url(../../uploads/banner1.jpg); /* Default image. */
background-repeat: no-repeat;
background-position: center top;
background-size: cover;
transition: background-image 1s linear;
/* Use additional CSS to control the `height` of `[data-slides]`, like so: */
mhulse /
Last active Mar 23, 2019
Image Magick command to convert images to the images average color and print file name in center of image
magick mogrify \
-colors 1 \
-shave 1x1 \
-bordercolor black \
-border 1 \
-pointsize 48 \
-fill black \
-gravity center \
-annotate +0+0 "%[f]" \
mhulse / Amazon S3 snippets and Transmit FTP cloud
Last active Feb 22, 2019
Amazon S3 snippets... Transmit FTP cloud settings... Other related goodies...
View Amazon S3 snippets and Transmit FTP cloud

S3 Website "Index Document"


<title>403 Forbidden</title>
mhulse /
Created Dec 13, 2012
Simple Python accessors (@getter/@Setter and @deleter) example/test using mixin and decorators... I'm using Python 2.6 for testing.
import pprint
# pprint.pprint(dir(obj))
# pprint.pprint(list)
# $ python runscript am_script2
class BaseMixin(object):
# Init:
mhulse / css.css
Created Jan 29, 2019
Slick Carousel CSS/JS; putting here for posterity’s sake
View css.css
.ap_library {
position: relative;
.ap_library > :first-child {
margin-top: 0;
.ap_library > :last-child {
margin-bottom: 0;
.ap_library {
You can’t perform that action at this time.