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 / gist:644c80f1c273f2e7e96a475b7b6aca5b
Last active March 2, 2022 21:56
Agile story point system
1 = 1-4 hours, a day or less, low complexity
2 = 1ish days, a day or so, medium complexity
4 = several days, 1/4 of a 3-week sprint, (maybe a meeting or two)
8 = the whole sprint, (and should likely be vetted to see if it can be broken up into two 4s, etc. break it down! potential blockers, meetings)
In general, there should be 16 points total for a developer, with 8-10 points for feature work (in a 1.5 week dev portion of the sprint).
@mhulse
mhulse / validators.py
Created June 13, 2011 18:04
Year validator for a Django (1.2+) IntegerField.
from django.core.exceptions import ValidationError
import time
import re
def validate_year(value):
"""
Validator function for model.IntegerField()
* Validates a valid four-digit year.
* Must be a current or future year.
@mhulse
mhulse / .htaccess
Created June 28, 2012 02:37
Wordpress demo .htaccess file...
# http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
order allow,deny
deny from all
</FilesMatch>
# http://css-tricks.com/snippets/htaccess/shock-teenage-gangsters-with-wp-config-redirect/
Redirect 301 /wp-config.php http://svr.gov.ru/
# Turn on the rewrite engine:
@mhulse
mhulse / helpers.py
Created June 15, 2011 19:34
Django (1.3) Google Maps v3 Geocoder service lookup example
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# http://djangosnippets.org/snippets/293/
# http://code.google.com/p/gmaps-samples/source/browse/trunk/geocoder/python/SimpleParser.py?r=2476
# http://stackoverflow.com/questions/2846321/best-and-simple-way-to-handle-json-in-django
# http://djangosnippets.org/snippets/2399/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhulse
mhulse / javascript-plugin-patterns-FOUND-protoytpe-newed.js
Last active May 16, 2021 14:45
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
// http://callmenick.com/post/slide-and-push-menus-with-css3-transitions
(function(window) {
'use strict';
/**
* Extend Object helper function.
*/
function extend(a, b) {
@mhulse
mhulse / Amazon S3 snippets and Transmit FTP cloud settings.md
Last active February 21, 2021 18:36
Amazon S3 snippets... Transmit FTP cloud settings... Other related goodies...

S3 Website "Index Document"

index.html:

<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
@mhulse
mhulse / test.bash
Created June 24, 2016 06:15
Testing some shit.
#!/usr/bin/env bash
open -b com.adobe.illustrator /Users/mhulse/github/mhulse/test/test.jsx
echo 'Done!'
exit 0
@mhulse
mhulse / jsonp_decorator.py
Created September 1, 2012 04:12
Django jsonp decorator
from django.http import HttpResponse
from django.utils import simplejson
def json_response(func):
"""
@json_response
A decorator thats takes a view response and turns it into json. If a callback is added
@mhulse
mhulse / Super simple background image slideshow.css
Last active January 18, 2020 12:46
Super simple jQuery background-image random slideshow (using CSS3 for the transition and gets the image paths via HTML5 `data` attribute).
[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: */