Skip to content

Instantly share code, notes, and snippets.

View davejlong's full-sized avatar

David Long davejlong

View GitHub Profile
@davejlong
davejlong / modal-window.css
Created June 17, 2010 18:42
Create a modal window by calling openWindow(window-source,ID to give window,width,height). You can also call loadLib(src of JS Library) to activate a JavaScript file required by the code in the window.
/* Z-Index of #mask must be lower than #boxes .window */
#mask{
position:absolute;
z-index:9000;
background-color:#000;
display:none;
}
#boxes .window{/* Setup all the defaults for the Modal Window */
position:absolute;
@davejlong
davejlong / Pretty-Button.css
Created July 17, 2010 14:31
A simple CSS3 snippet to create pretty buttons.
#btn_pretty{
-moz-border-radius: 4px;-webkit-border-radius: 4px;border-radius: 4px;
-moz-box-shadow: 0px 0px 4px #000;-webkit-box-shadow: 0px 0px 4px #000;box-shadow: 0px 0px 4px #000;
border:none;
background-color:#E7AF00;
padding:5px;
display:inline-block;
text-decoration:none;
color:#Fff;
text-shadow: 1px 1px 1px #2e2e2e;
<cffunction name="dspNestedNav" output="false" returntype="string">
<cfargument name="contentid" type="string" >
<cfargument name="viewDepth" type="numeric" required="true" default="1">
<cfargument name="currDepth" type="numeric" required="true" default="1">
<cfargument name="type" type="string" default="default">
<cfargument name="today" type="date" default="#now()#">
<cfargument name="class" type="string" default="">
<cfargument name="querystring" type="string" default="">
<cfargument name="sortBy" type="string" default="orderno">
<cfargument name="sortDirection" type="string" default="asc">
@davejlong
davejlong / dsp_calendarJump.cfm
Created August 20, 2010 18:26
Mura CMSdisplay object to select a month and year to jump to on Calendar type pages
Gist has been moved into Mura plugin at http://github.com/davidlong03/more-dspobjects.
<cfif $.content('Type') EQ 'calendar'>
<cfsilent>
<cfscript>
if(structKeyExists(URL,'month'))cMonth = URL.month;
else cMonth = month(now());
if(structKeyExists(URL,'year'))cYear = URL.year;
else cYear = year(now());
</cfscript>
@davejlong
davejlong / dsp_sectionSearch.cfm
Created August 23, 2010 19:42
Mura CMS Display Object Searches within the current section.
Gist has been moved into Mura plugin at http://github.com/davidlong03/more-dspobjects.
<cfoutput>
<form name="selectDate" method="post" action="?display=search">
<input type="hidden" name="searchSectionID" value="#$.content('contentid')#" />
<input type="hidden" name="display" value="search" />
<input type="hidden" name="newSearch" value="true" />
<input type="hidden" name="noCache" value="1" />
<fieldset>
<legend>Search in #$.content('menutitle')#</legend>
@davejlong
davejlong / popup-bubble.css
Created September 27, 2010 14:43
A simple jQuery script that will create a popup bubble that fixes the issue of disappearing when the mouse hovers over the bubble. Tested with jQuery 1.2.3 and 1.4.2
.popupBubble{
position:relative;
display:inline;
}
.popupBubble .popup{
position:absolute;
display:none;
border:1px solid #AAA;
background:#FFF;
padding:5px;
@davejlong
davejlong / renderFileSize.cfm
Created October 28, 2010 13:27
A ColdFusion Function that Renders a File Size in an easily readable format (uses 1024)
<cffunction name="renderFileSize" access="public" output="false" hint="Returns file size in either b, kb, mb, gb, or tb">
<cfargument name="size" type="numeric" required="true" hint="File size to be rendered" />
<cfargument name="type" type="string" required="true" default="bytes" />
<cfscript>
local.newsize = ARGUMENTS.size;
local.filetype = ARGUMENTS.type;
do{
local.newsize = (local.newsize / 1024);
if(local.filetype IS 'bytes')local.filetype = 'KB';
@davejlong
davejlong / Example 1
Created November 16, 2010 19:32
What is wrong here?
<cfset foo = arrayNew(1)>
<cfset foo[1] = 'bar' />
<cfset foo[2][1] = 'bar2' />
<cfdump var="#foo#" />
<cfset bar = arrayNew() />
<cfset bar[1][1] = 'foo' />
<cfset bar[2][2] = 'foo2' />
<cfdump var="#bar#" />
@davejlong
davejlong / server.js
Created December 26, 2010 23:23
An Improved Node.js server with default index.htm document and global 404 and 500 error handlers.
var sys = require("sys"),
http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs");
//Create the server wrapper
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname;
console.log('URI: ' + uri);
/* Primary Nav ================================ */
div#nav-wrapper{
background: url(../images/nav-bkg.png) repeat-x;
width: 100%;
height: 40px;
float: left;
}
#navPrimary{
height: 40px;
padding: 0;