Skip to content

Instantly share code, notes, and snippets.

View mhulse's full-sized avatar
👋
👁 ❤️ open source software …

Michael Hulse mhulse

👋
👁 ❤️ open source software …
  • Instructure Inc.
  • Eugene, Oregon
View GitHub Profile
@mhulse
mhulse / httpd.vhosts.conf
Created February 1, 2015 20:55
Apache Tomcat 8.0: How to get “Virtual hosting” to work with port removed on OS X Yosemite?
# http://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html
# https://gerrydevstory.com/2013/06/29/tomcat-apache-reverse-proxy/
# http://www.latko.org/2009/02/12/installing-tomcat-60x-behind-apache-22x/
# http://stackoverflow.com/a/20584597/922323
# https://raajasoft.wordpress.com/2011/11/27/to-shorten-the-tomcat-application-url/
# http://www.christianroessler.net/tech/2012/apache-vhost-proxy-and-static-files.html
# http://sysadminnotebook.blogspot.com/2011/08/apache-reverse-proxy-of-virtual-hosts.html
# http://stackoverflow.com/a/8823415/922323
<VirtualHost *:80>
ServerName tomcat.local
@mhulse
mhulse / allow_tags.py
Created February 4, 2012 00:52
[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()
# http://www.soyoucode.com/2011/set-variable-django-template
# http://djangosnippets.org/snippets/861/
# http://stackoverflow.com/questions/4183252/what-django-resolve-variable-do-template-variable
# https://docs.djangoproject.com/en/dev/ref/templates/api/
@mhulse
mhulse / image-average-file-name.sh
Last active March 23, 2019 21:33
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
mhulse / am_script2.py
Created December 13, 2012 20:48
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 manage.py runscript am_script2
class BaseMixin(object):
#----------------------------------
# Init:
@mhulse
mhulse / css.css
Created January 29, 2019 21:05
Slick Carousel CSS/JS; putting here for posterity’s sake
.ap_library {
position: relative;
}
.ap_library > :first-child {
margin-top: 0;
}
.ap_library > :last-child {
margin-bottom: 0;
}
.ap_library {
@mhulse
mhulse / xfer-repos-from-bitbucket-to-github.sh
Last active January 11, 2019 07:34
Simple script to transfer multiple repos from Bitbucket to GitHub (or vice versa). Inspired by https://stackoverflow.com/a/21260628/922323
#!/usr/bin/env bash
# This script assumes you have your ssh keys setup for Bitbucket and GitHub.
# It also assumes you have created the repos on GitHub already and the URL slugs are an exact match.
# Also, this script will barf if you try to transfer an empty repo.
# Note that this code does not transfer wikis, downloads or issues.
# Also note, you may have to turn on QOS upload speed limiting so your router
# doesn’t freak out; I limited my upload bandwidth to 2Mbps.
# Don’t forget to `chmod u+x <this file>.sh` in order to execute it via `./<this file>.sh`.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhulse
mhulse / data.css
Last active August 1, 2018 17:45
CSS from picard, data, other themes
/*! Data v0.1.0 | Apache License, Version 2.0 | https://github.com/mhulse/data */
/* https://github.com/mhulse/data/blob/19fb318ee633eae44f40ffbd709e52a22f8248e9/prod/0.1.0/20140927/1/styles/data.min.css */
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
@mhulse
mhulse / 1. plug-stub.js
Created June 18, 2014 21:10
Just an example JS plugin pattern I like to use as starting point for utility-esque JS projects/needs.
/**
* Plugin example using pure javascript.
*
* Patterns used: "closure", "alias" and "namespace extension".
*
* @see http://stackoverflow.com/a/12774919/922323
* @param {object} stub
* @param {object} window
* @param {object} document
* @param {undefined} undefined