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 / shprite
Last active June 13, 2016 04:04
Simple bash command line script to make sprite textures for video games.
#!/usr/bin/env bash
function init() {
clear
# Display instructions:
echo -e "\033[1mSIMPLE SPRITE SHEET CREATION SCRIPT\033[0m"
echo "-----------------------------------"
echo "1. Navigate to the folder that contains your tile images."
@mhulse
mhulse / bridgeTalkExample.jsx
Created June 11, 2016 05:38
Another Adobe Illustrator BridgeTalk boilerplate example.
/* jshint laxbreak:true, -W043 */
/* globals app, $, BridgeTalk */
// jshint ignore:start
#target illustrator
#targetengine main
// jshint ignore:end
var TEST = (function($application, $helper, undefined) {
@mhulse
mhulse / graphic_to_text.jsx
Last active June 11, 2016 03:43
Illustrator convert images into strings for embedding in scripts (copied from ScriptUI for dummies: http://www.kahrel.plus.com/indesign/scriptui.html), page 122.
function graphic_to_text(infiles) { // Array of file objects.
var outfile,
s,
re1 = /^\(new String\(/,
re2 = /\)\)$/;
for (var i = 0; i < infiles.length; i++) {
if (infiles[i].exists) {
outfile = File (infiles[i].fullName.replace (/\.(png|idrc)$/, '.txt'));
outfile.open ('w');
infiles[i].encoding = 'BINARY';
@mhulse
mhulse / Install Blender Plugins.command
Created June 9, 2016 01:46
MakeHuman installation bash script
#!/bin/bash
# Ensure we are working from the same directory this script is in
cd "$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
clear
export BLENDER_CONFIG_DIR=~/Library/Application\ Support/Blender
export CURRENT_WORKING_DIRECTORY=$(pwd)
export BLENDER_PLUGINS_DIR=$CURRENT_WORKING_DIRECTORY/Blender\ Plugins
@mhulse
mhulse / close.svg
Created June 7, 2016 18:49
A cleaned-up Angular page slide navigation example (https://github.com/dpiccone/ng-pageslide)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mhulse
mhulse / nav.css
Created May 31, 2016 00:19
Responsive navigation test [unfinished]
/* https://github.com/arnaudleray/pocketgrid */
.block,
.block::before,
.block::after,
.block-group,
.block-group::before,
.block-group::after {
-webkit-box-sizing: border-box;
-khtml-box-sizing: border-box;
-moz-box-sizing: border-box;
@mhulse
mhulse / create-layer-add-point-text.jsx
Created May 8, 2016 00:47
Check for and create a layer in JSX (Illustrator); if layer already exists, do nothing. Otherwise, create layer and add point text at varying offsets.
#target Illustrator
var idoc = idoc;
var ilayer;
var exists = function(name) {
var i;
var il;
for (i = 0, il = idoc.layers.length; i < il; i++) {
if (idoc.layers[i].name == name) {
return true;
@mhulse
mhulse / phantom.js
Created April 1, 2016 06:03
testing phantom.js
console.log('2,3');
phantom.exit();
<!doctype html>
<html class="no-js no-touch" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script>/*! no-js uglified | https://gist.github.com/mhulse/4704893 */!function(e){e.documentElement.className=e.documentElement.className.replace(/\bno-js\b/,"js")}(document);</script>
<script>/*! no-touch uglified | https://gist.github.com/mhulse/4704893 */!function(o,n,c){("ontouchstart"in o||o.DocumentTouch&&n instanceof DocumentTouch||c.MaxTouchPoints>0||c.msMaxTouchPoints>0)&&(n.documentElement.className=n.documentElement.className.replace(/\bno-touch\b/,"touch"))}(window,document,navigator);</script>
@mhulse
mhulse / index.js
Last active October 14, 2016 16:38
Testing Übersicht and cURL …
// http://localhost:41416/
// … and then view console log.
gist: 'https://gist.githubusercontent.com/mhulse/93191698219b33471883a4846dd47809/raw/keys.json',
command: 'lsappinfo info -only bundlepath `lsappinfo front`',
refreshFrequency: '5s',
style: [