Skip to content

Instantly share code, notes, and snippets.

🖐
👁❤️open source software …

Michael Hulse mhulse

🖐
👁❤️open source software …
Block or report user

Report or block mhulse

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
@mhulse
mhulse / stavffEmail.csp
Created Apr 6, 2011
Get staff e-mails via DTI's Content Publisher CMS. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
View stavffEmail.csp
<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 Apr 6, 2011
Returns a relative date. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
View relativeDate01.csp
<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 Apr 7, 2011
Trim whitespace around items in a delimited string. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
View cleanList.csp
<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 Apr 12, 2011
Previous/Next story in section: 2011 update for DTI's Content Publisher (Lightning) CMS 7.6.x!
View story.csp
<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 Apr 21, 2011
Test if document class or assigned to movieclip/sprite in library.
View Test.as
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
Caché Objecscript CSP method used to extract strings out of other strings.
View nab.csp
<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
DTI's Content Publisher CMS: Just experimenting with some code that gets all SWFs attached to a story.
View swfsize.csp
<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 Sep 25, 2015
Caché Objecscript CSP code that obtains/tests for Extra CGI Environment Variables.
View cgi.csp
<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
HTML5 example code.
View html5example.html
<div id="container">
<header>
<!-- Site logo/flag here -->
</header>
<section>
@mhulse
mhulse / test.css
Created May 20, 2011
HTML5 bare bones template with Selectivizr and jquery (code used to find a bug with the JS and background image).
View test.css
#container {
padding: 5em;
padding: 10px;
}
#flag {
line-height: 1;
text-indent: -999em;
width: 79px;
height: 48px;
You can’t perform that action at this time.