Skip to content

Instantly share code, notes, and snippets.

component extends="config.WireBox" {
function configure(){
super.configure();
map("search.SearchService").to("models.SearchServiceCustom").asSingleton();
}
}
/*
** SearchService.cfc
*/
component {
public string function getSearchResults(string query) {
return "I just searched for #arguments.query#";
}
}
package uk.ebiz.lucee.controller;
import io.milton.annotations.*;
import io.milton.http.http11.auth.DigestGenerator;
import io.milton.http.http11.auth.DigestResponse;
import io.milton.resource.AccessControlledResource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import uk.ebiz.lucee.communicator.LuceeCommunicator;
@tgmweb
tgmweb / 0_reuse_code.js
Created January 22, 2014 17:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tgmweb
tgmweb / ElasticSearch
Created July 18, 2013 17:16
Example CFC for elasticSearch interface
<cfcomponent output="false" >
<cffunction name="init" access="public" returntype="any" >
<!--- this just sets up the CFC with the elasticSearch URL and port --->
<cfargument name="searchEndPoint" type="string" required="true"/>
<cfargument name="searchPort" type="string" required="true"/>
<cfset variables.searchEndPoint = arguments.searchEndPoint />
<cfset variables.searchPort = arguments.searchPort />
<cfreturn this />
</cffunction>
@tgmweb
tgmweb / BMF SQL
Last active December 14, 2015 19:09
Branch Locator SQL Script
<cfquery name="geteverything" datasource="bmf" result="info">
SELECT
organisation.*,
address.*
<cfif radius neq "" AND lat neq "" AND lng neq ""> <!--- they are searching by location --->
,
(
3959 * acos(
cos(
radians('#lat#') <!--- passed in latitude from client side script --->