Skip to content

Instantly share code, notes, and snippets.

Philip Hutchison pipwerks

Block or report user

Report or block pipwerks

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pipwerks
pipwerks / Convert "localhost" address to your Mac's current IP address
Last active Aug 29, 2015
AppleScript for converting "localhost" address to your Mac's current IP address. This enables testing in VMs (they can't resolve localhost but *can* resolve the local IP). This also enables your coworkers to view pages being served from your Mac. Read more at http://pipwerks.com/2014/03/08/convert-localhost-to-your-macs-current-ip-address/
View Convert "localhost" address to your Mac's current IP address
(* functions *)
-- string replace function from http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Default Captivate Output for SCORM 2004 Template
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="standard.js" type="text/javascript"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script type="text/javascript" language="JavaScript">
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, JavaScript in <head> externalized to separate file named captivate.js
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0;
// Hook for Internet Explorer
if ((navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) || g_intAPIType == -1)
{
g_intAPIType = 0;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub Captivate_FSCommand(ByVal command, ByVal args)\n');
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, converted to HTML5 doctype
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js" type="text/javascript"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script type="text/javascript" language="JavaScript" src="captivate.js"></script>
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, cleaned up <script> elements
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, cleaned up <body> tag
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, cured <center>itis
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, changed <noscript>
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
@pipwerks
pipwerks / sample.htm
Created Jan 12, 2012
Captivate SCORM 2004 Output, removed <table> generated by JavaScript
View sample.htm
<!-- Copyright [2008] Adobe Systems Incorporated. All rights reserved -->
<!-- saved from url=(0013)about:internet -->
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
<script src="captivate.js"></script>
@pipwerks
pipwerks / captivate.js
Created Jan 12, 2012
Captivate SCORM 2004 Output, all inline JavaScript removed
View captivate.js
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
var g_intAPIType = 0;
// Hook for Internet Explorer
if ((navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) || g_intAPIType == -1)
{
g_intAPIType = 0;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub Captivate_FSCommand(ByVal command, ByVal args)\n');
You can’t perform that action at this time.