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 / DetectDrag.as
Last active March 13, 2023 11:53
AS3: Drag object and detect what’s under the mouse during move.
package {
import flash.display.*;
import flash.events.*;
public class Main extends MovieClip {
// Constructor:
public function Main() {
@mhulse
mhulse / fromhex.bash
Last active March 13, 2024 22:15
Bash function to convert hex to 256 terminal color.
# fromhex A52A2A
# fromhex "#A52A2A"
# BLUE_VIOLET=$(fromhex "#8A2BE2")
# http://unix.stackexchange.com/a/269085/67282
function fromhex() {
hex=$1
if [[ $hex == "#"* ]]; then
hex=$(echo $1 | awk '{print substr($0,2)}')
fi
r=$(printf '0x%0.2s' "$hex")
@mhulse
mhulse / show-or-hid-el-from-select-option.css
Created March 4, 2016 17:48
jQuery snippet: Show or hide another element from select option, on change.
#foo-other { display: none; }
@mhulse
mhulse / data.json
Last active December 5, 2016 14:49
Illustrator script that uses the command line to cURL a JSON file on remote server. This is just an example and experiment, not meant for production purposes. UNIX required. Not Windows-friendly, sorry. :(
{
"key": "value"
}
@mhulse
mhulse / README.md
Created January 23, 2016 23:00
Illustrator scripts installation location.

Installation location:

/Applications/Adobe\ Illustrator\ CC\ 2014/Presets.localized/en_US/Scripts

scripts

Restart Illy and you should now see:

@mhulse
mhulse / Boilerplate.jsx
Created December 27, 2015 05:53
Adobe Illustrator JSX boilerplate. Starter script for new ExtendScript JS plugins.
/* jshint laxbreak:true, -W043, -W030 */
/* globals app */
// jshint ignore:start
#target illustrator
#targetengine main
// jshint ignore:end
/**
* @@@BUILDINFO@@@ Boilerplate.jsx !Version! Fri Dec 25 2015 22:47:45 GMT-0800
@mhulse
mhulse / SelectActiveLayers.jsx
Last active December 10, 2023 00:50
Adobe Illustrator script to select highlighted layers. Written by @Qwertyfly and only slightly modified by me. Original code and discussion can found here: https://forums.adobe.com/message/8328893
#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
mhulse / README.md
Last active December 22, 2015 22:26
JavaScript solution to rotate html page (<body>...</body>) based on attribute; updates on window resize. Designed for use with digital signage HDTV displays. Currently only tested via Chrome OS X.

Kiosk rotate script

Assuming you have styles similar to this:

html {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
@mhulse
mhulse / palette-demo-with-bridgetalk-v2.jsx
Last active June 11, 2016 05:41
Adobe Illustrator JSX script demo using BridgeTalk to communicate with palette window.
/* globals $, app, BridgeTalk */
#target illustrator
#targetengine main
/**
* @see https://gist.github.com/mhulse/aac5d6782868b612320b
* @see https://gist.github.com/mhulse/eb0ffb2bd365975632d2
*/
@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) {