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 / stavffEmail.csp
Created April 6, 2011 22:17
Get staff e-mails via DTI's Content Publisher CMS. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment>
<script language="cache" method="email" arguments='name:%String=""' returntype="%String" procedureblock="1">
set return = ""
try {
set currentNS = $znspace
znspace ##class(dt.common.NamespaceProcs).GetLocationsName()
@mhulse
mhulse / relativeDate01.csp
Created April 6, 2011 22:21
Returns a relative date. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment>
<script language="cache" method="timesince" arguments='ts1:%String="", ts2:%String=""' returntype="%String" procedureblock="1">
/*
**
** Note: dformat/tformat are not currently used.
** Read comments below for more info.
**
** More info:
@mhulse
mhulse / cleanList.csp
Created April 7, 2011 00:50
Trim whitespace around items in a delimited string. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
<script language="cache" method="OnPreHTTP" arguments="" returntype="%Boolean">
do %response.SetHeader("Content-Type", "text/plain")
quit 1
</script>
#[ new string set string = " Top Story , Top Stories , Other Stories , Bulleted Stories " ]#
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment>
<script language="cache" method="cleanListM1" arguments='str:%String=""' returntype="%List" procedureblock="1">
@mhulse
mhulse / story.csp
Created April 12, 2011 00:35
Previous/Next story in section: 2011 update for DTI's Content Publisher (Lightning) CMS 7.6.x!
<dti:file:include base="assets" file="/includes/csp/story.prevnext.inc.csp?areas=Top Story,Top Stories,Other Stories,Bulleted Stories,Updates" />
@mhulse
mhulse / Test.as
Created April 21, 2011 01:42
Test if document class or assigned to movieclip/sprite in library.
package {
// Imports:
import flash.display.*;
import flash.events.*;
/**
* AS3 test class.
*
* <p>Tests if this class is a "Document" class
@mhulse
mhulse / nab.csp
Created May 5, 2011 18:12
Caché Objecscript CSP method used to extract strings out of other strings.
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment>
<script language="cache" method="nab" arguments='haystack:%String="", from:%String="", to:%String=""' returntype="%String" procedureblock="1">
set return = ""
if ($length(haystack) && $length(from) && $length(to)) {
//set from = "data="""
//set to = """"
@mhulse
mhulse / swfsize.csp
Created May 5, 2011 19:10
DTI's Content Publisher CMS: Just experimenting with some code that gets all SWFs attached to a story.
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment>
<script language="cache" method="getSwf" arguments='cmsStory:dt.cms.schema.CMSStory=-1' returntype="%ArrayOfDataTypes" procedureblock="1">
set sc = $$$OK
set return = ##class(%ArrayOfDataTypes).%New()
set storyId = cmsStory.story.storyId
set currentNS = $znspace
znspace ##class(dt.common.NamespaceProcs).GetNewsMediaName()
@mhulse
mhulse / cgi.csp
Last active September 25, 2015 19:17
Caché Objecscript CSP code that obtains/tests for Extra CGI Environment Variables.
<ol>
<li>AUTH_PASSWORD: #($get(%request.CgiEnvs("AUTH_PASSWORD"), "empty"))#</li>
<li>AUTH_TYPE: #($get(%request.CgiEnvs("AUTH_TYPE"), "empty"))#</li>
<li>CONTENT_TYPE: #($get(%request.CgiEnvs("CONTENT_TYPE"), "empty"))#</li>
<li>GATEWAY_INTERFACE: #($get(%request.CgiEnvs("GATEWAY_INTERFACE"), "empty"))#</li>
<li>HTTP_ACCEPT_CHARSET: #($get(%request.CgiEnvs("HTTP_ACCEPT_CHARSET"), "empty"))#</li>
<li>HTTP_ACCEPT_LANGUAGE: #($get(%request.CgiEnvs("HTTP_ACCEPT_LANGUAGE"), "empty"))#</li>
<li>HTTP_AUTHORIZATION: #($get(%request.CgiEnvs("HTTP_AUTHORIZATION"), "empty"))#</li>
<li>HTTP_COOKIE: #($get(%request.CgiEnvs("HTTP_COOKIE"), "empty"))#</li>
<li>HTTP_REFERER: #($get(%request.CgiEnvs("HTTP_REFERER"), "empty"))#</li>
@mhulse
mhulse / html5example.html
Created May 15, 2011 19:15
HTML5 example code.
<div id="container">
<header>
<!-- Site logo/flag here -->
</header>
<section>
@mhulse
mhulse / test.css
Created May 20, 2011 23:06
HTML5 bare bones template with Selectivizr and jquery (code used to find a bug with the JS and background image).
#container {
padding: 5em;
padding: 10px;
}
#flag {
line-height: 1;
text-indent: -999em;
width: 79px;
height: 48px;