Skip to content

Instantly share code, notes, and snippets.

View pipwerks's full-sized avatar

Philip Hutchison pipwerks

View GitHub Profile
@pipwerks
pipwerks / Convert "localhost" address to your Mac's current IP address
Last active August 29, 2015 13:57
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/
(* 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 / AppleScript for generating SCORM manifest <file> nodes
Created February 24, 2014 00:27
AppleScript that generates list of files for the <resource> node in a SCORM manifest. Select the directory containing your content, and the script will generate the list, then copy to your clipboard. Results are formatted like this: <file href="index.html" />
(*
Based on http://www.jonn8.com/html/scripts/misc/List_Folder_Contents.html
with string replacement function from https://discussions.apple.com/message/20542403#20542403
*)
property script_name : "List Folder Contents"
property script_description : "This script will list a folder's contents returning full paths as strings and limit the list to specific file types. The script can also process subfolders (recursion)."
set the_folder to (choose folder with prompt "Choose a Folder to List:") as Unicode text
set file_types to {} --file types, set to {} to true to just return folders; file types are 4 character codes such as "osas" or "TEXT"
@pipwerks
pipwerks / Ungraded quiz with feedback
Created May 17, 2013 06:20
Updated "ungraded quiz with feedback" example. Uses jQuery. Warning: this example is NOT keyboard accessible, and will require a mouse or touch interaction.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sample ungraded question with feedback</title>
<style>
/* basic page styling */
body { font-family: sans-serif; color: #444; font-size: small; margin: 0px; padding: 2em; background: #eee; }
h1 { font-size: xx-large; font-weight: normal; color: #777; }
h2 { font-size: x-large; font-weight: normal; }
@pipwerks
pipwerks / sample.htm
Created January 18, 2012 08:33
Captivate SCORM 2004 Output, final cleanup
<!DOCTYPE HTML>
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@MOVIETITLE</title>
<script>
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
@pipwerks
pipwerks / sample.htm
Created January 18, 2012 07:56
Captivate SCORM 2004 Output, centering SWF
<!DOCTYPE HTML>
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@MOVIETITLE</title>
<script>
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
@pipwerks
pipwerks / sample.htm
Created January 18, 2012 07:22
Captivate SCORM 2004 Output, fixed RightClick functionality when using SWFObject 2.2
<!DOCTYPE HTML>
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@MOVIETITLE</title>
<script>
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
@pipwerks
pipwerks / sample.htm
Created January 18, 2012 05:47
Captivate SCORM 2004 Output, setting up template
<!DOCTYPE HTML>
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@MOVIETITLE</title>
<script>
// set document.domain property here, if it works for your environment/SCORM implementation
// document.domain="";
@pipwerks
pipwerks / sample.htm
Created January 17, 2012 08:22
Captivate SCORM 2004 Output, created CONFIG object
<!-- 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>@MOVIETITLE</title>
<script>
// set document.domain property here, if it works for your environment/SCORM implementation
@pipwerks
pipwerks / sample.htm
Created January 17, 2012 07:06
Captivate SCORM 2004 Output, eliminate captivate.js
<!-- 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="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script src="standard.js"></script>
<script src="SCORM_support/scorm_support.js"></script>
@pipwerks
pipwerks / log.txt
Created January 14, 2012 08:06
Captivate SCORM 2004 Course -- logged calls to Captivate_DoExternalInterface
SCORM initialized. Ready to go!
http://cloud.scorm.com/content/courses/FTYR5Q0IM4/Archive4056f446-8c7e-4794-82d1-5c9f40b2a302/0/MMTracking.swfFailed to load resource: the server responded with a status of 404 (Not Found)
Captivate_DoExternalInterface: Initialize, , ''
Captivate_DoExternalInterface: GetValue, cmi.entry, ''
Captivate_DoExternalInterface: GetLastError, , ''
Captivate_DoExternalInterface: SetValue, cmi.exit, suspend
cmi.exit(suspend) is not cached. Sending to LMS.
Captivate_DoExternalInterface: GetLastError, , ''
Last Get/Set was successful. Preventing pointless GetLastError invocation.
Captivate_DoExternalInterface: GetValue, cmi.location, ''