Skip to content

Instantly share code, notes, and snippets.

View 65's full-sized avatar

Duncan Isaksen-Loxton 65

View GitHub Profile
@65
65 / analytics.cfm
Created March 11, 2012 08:24
Filtering your traffic from Google Analytics - the better way
<cfif isUserInRole('Admin')>
<body onLoad="javascript:__utmSetVar('AdminUser')">
<cfelse>
<body>
</cfif>
cleanmgr /d c: /sageset:1
@65
65 / error.txt
Created March 11, 2012 08:13
utf-7 encoding error when using cfpop
Unable to retrieve message content: java.io.UnsupportedEncodingException: unicode-1-1-utf-7
<cfoutput>
<cfif pod eq int(arraylen(podlist)/2)+1>
</div>
<div style="float:right;width:50%;">
</cfif>
</cfoutput>
@65
65 / copy.sql
Created March 11, 2012 08:02
Copy tables between SQL databases
SELECT *
INTO NewTable
FROM existingdb.dbo.existingtable;
@65
65 / ajax.js
Created March 11, 2012 07:59
AJAX in IE7 and its so called native xmlhttp
var xml = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
@65
65 / query.sql
Created March 11, 2012 07:58
Random rows in SQL
SELECT TOP 1 column
FROM table
ORDER BY NEWID()
@65
65 / info.txt
Created March 11, 2012 07:57
Windows version from CGI.HTTP_USER_AGENT
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
@65
65 / images.cfm
Created March 11, 2012 07:46
BlogCFC Flickr Images Pod
<cfsetting enablecfoutputonly=true>
<cfprocessingdirective pageencoding="utf-8">
<cfmodule template="../../tags/scopecache.cfm" cachename="pod_images" scope="application" timeout="#application.timeout#">
<cfmodule template="../../tags/podlayout.cfm" title="Recent Flickr">
<cfoutput>
</cfoutput>
</cfmodule>
</cfmodule>
<cfsetting enablecfoutputonly=false>
@65
65 / dDumper.js
Created March 11, 2012 07:42
ColdFusion style variable dump for javascript
dDumper(myQuery);