Skip to content

Instantly share code, notes, and snippets.

View 65's full-sized avatar

Duncan Isaksen-Loxton 65

View GitHub Profile
@65
65 / cfobject.net.cfm
Created March 5, 2012 09:20
using coldfusion .net integration
<!--- connect to the .NET object --->
<cfobject type=".NET" name="v3assembly.obj" class="V3Leisure.CABS.WebServices.Examples.CABSExamplesUI.BLL.#Method#" assembly="#application.path#\lib\CABSExamplesUI.BLL.dll" />
<!--- build up the info to send to the .NET assembly --->
<cfset v3assembly.uri = JavaCast("string","http://www.au.v3travel.com/CABS.WebServices/SearchServiceAdapters.asmx")>
<cfset v3assembly.xml = JavaCast("string",XMLParse(XML))>
<cfset v3assembly.bool = JavaCast("boolean",true)>
<cftry>
<!--- return the response from the V3 assembly --->
<cfreturn XmlParse(v3assembly.obj.SendRequest(v3assembly.uri,v3assembly.xml,v3assembly.bool))>
<cfcatch>
@65
65 / sshant.xml
Created March 5, 2012 09:26
ssh in ant build file
<target name="SSHunzip">
<echo message="Unzipping Zip file" />
<sshexec host="${projectURL}" username="${SSH.Username}" password="${SSH.Password}" trust="true" command="unzip -o ${FTP.Development.RemoteLocation}/${projectName}.${build.number}.${svn.info.rev}.zip -d ${FTP.Development.RemoteLocation}"/>
</target>
@65
65 / cfant.cfm
Created March 5, 2012 09:43
cfant tag
<cfset buildFile = 'e:\sites\' & SiteName & '\httpdocs\build\build.xml'>
<cfant buildFile="#buildFile#" defaultDirectory="" anthome="C:\Program Files\apache-ant-1.7.1\" messages="output" target="updateserver"/>
@65
65 / geocoded.sql
Created March 5, 2012 09:34
finding distance using SQL server between geocoded points
SELECT postcode, (3959*acos((sin(#latitude#/57.3) * sin(latitude/57.3))+ (cos(#latitude#/57.3) * cos(latitude/57.3) * cos((#longitude# - longitude)/57.3))))*8/5 AS exactDistance
FROM postcode
WHERE 1=1
ORDER BY (3959*acos((sin(#latitude#/57.3) * sin(latitude/57.3))+ (cos(#latitude#/57.3) * cos(latitude/57.3) * cos((#longitude# - longitude)/57.3))))*8/5
@65
65 / cfhttp.cfm
Created March 5, 2012 10:02
helping coldfusion cfhttp work with http compression
<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">
@65
65 / cfform.cfm
Created March 8, 2012 07:53
ColdFusion 8 - Ajax Debugger
<cfform>
<cftree name="dirtree" format="html">
<cftreeitem bind="cfc:dirtree.getDirEntries({cftreeitempath}, {cftreeitemvalue})">
</cftree>
</cfform>
@65
65 / ContactPos.html
Created March 8, 2012 21:34
ajaxCFC Multiple Suggest on one page
<input id="fldPositionLookup" name="fldPositionLookup" value="#qContact.Position#" style="width:300px" maxlength="120" class="textfield" autocomplete="off" onFocus="onSuggestFieldFocus(positionLookup)">
@65
65 / cfthread.cfm
Created March 9, 2012 17:45
cfthread - pause or sleep a thread in ColdFusion 8
<cfthread action="sleep" duration="2000" />
@65
65 / redirect.php
Created March 9, 2012 17:51
301 Permanent redirects in PHP
<?
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.sixfive.co.uk/products/?ASIN=".$_GET['asin']);
?>
@65
65 / header.cfm
Created March 9, 2012 17:59
301 Permanent redirects in ColdFusion
<CFHEADER statuscode="301" statustext="Moved Permanently">
<CFHEADER name="Location" value="http://www.sixfive.co.uk/">