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 / palette-demo-with-bridgetalk.jsx
Last active June 11, 2016 05:40
Adobe Illustrator JSX script demo using BridgeTalk to communicate with palette window.
#target illustrator
#targetengine main
var NS = 'FOO';
var TITLE = 'Test';
var doc = app.activeDocument; // Just to show that this can be here ...
// BridgeTalk message:
var btm = function(fun_name, parameters) {
@mhulse
mhulse / simple-video-controller.js
Last active November 10, 2015 21:25
Simple JavaScript video controller: Click to play and pause HTML5 video tags. Full native video controls show after first play.
/**
* https://gist.github.com/mhulse/87725fa670412f379980
*/
(function(document) {
'use strict';
var i;
var $videos = document.querySelectorAll('.simple-video-controler');
var l = $videos.length;
var setup = function($video) {
@mhulse
mhulse / just-os.js
Last active October 29, 2015 21:50
Super simple browser version and OS sniffer.
navigator.os = (function(navigator) {
'use strict';
var os = '';
var i;
var l;
var map1 = ['win', 'mac', 'x11', 'linux'];
var map2 = ['Windows', 'Mac', 'Unix', 'Linux'];
for (i = 0, l = map1.length; i < l; i++) {
if (navigator.appVersion.toLowerCase().indexOf(map1[i]) != -1) {
os = map2[i];
@mhulse
mhulse / object_drop_to_ground.py
Last active November 8, 2016 14:26
Tested with Blender 2.7.6, Drop to ground drops selected objects onto the active object
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@mhulse
mhulse / Singleton.as
Last active November 9, 2015 18:10
Singleton class I use for AS3 projects.
// https://gist.github.com/mhulse/dbc517203ceddda2f675
package com.ieqtech {
import flash.display.*;
import flash.events.*;
// http://stackoverflow.com/a/13318889/922323
public final class Singleton extends MovieClip {
private static var _instance:Singleton;
@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: */
@mhulse
mhulse / not-online.js
Last active August 29, 2015 14:19
[not-online] Simplistic JavaScript code to detect if network is online/offline; "online" is assumed to be the default mode.
/*! not-online | https://gist.github.com/mhulse/ce208d2c64f1ce160a6a */
;(function(document, navigator) {
!navigator.onLine && (document.documentElement.className = document.documentElement.className.replace(/\bonline\b/, 'not-online'));
}(document, navigator));
/*! not-online uglified | https://gist.github.com/mhulse/ce208d2c64f1ce160a6a */!function(document,navigator){!navigator.onLine&&(document.documentElement.className=document.documentElement.className.replace(/\bonline\b/,"not-online"))}(document,navigator);
@mhulse
mhulse / device.css
Last active August 29, 2015 14:17 — forked from jsoverson/device.css
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@mhulse
mhulse / foo.js
Last active August 29, 2015 14:16
Simple way to create a Jquery function for non-jQuery JS code.
// Create the plugin:
window.jQuery.fn.autosize = function() {
return autosize(this);
};
// Use the plugin:
jQuery(function($){
$('textarea').autosize();
});
@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