Skip to content

Instantly share code, notes, and snippets.

//////////////////////
// 1. crawler config
crawlerConfig = createObject("java", "com.norconex.collector.http.crawler.HttpCrawlerConfig");
// straight test. does the default crawlerconfig have its appropriate methods. ?
//writeDump(crawlerConfig); //YES
@obxpete
obxpete / testCloudsearch.json
Last active November 2, 2017 21:17
exaple content for cfAWSCloudSearchExample.cfc gist
[
{"type": "add",
"id": "tt0484562",
"fields": {
"title": "CloudSearch Rocks",
"content": "hello world",
"coid":42,
"minimumUserLevel": 500
}
}
@obxpete
obxpete / cfAWSCloudSearchExample.cfc
Last active November 2, 2017 21:23
AWS CloudSearch File/Data upload/update example in ColdFusion
// Create basic AWS credentials properties
BasicAWSCredentials = createObject("java", 'com.amazonaws.auth.BasicAWSCredentials').init(yourAccessKey, YourSecretKey);
// turn credentials into a provider object
AWSCredentialsProviderObj = createObject("java", "com.amazonaws.auth.AWSStaticCredentialsProvider").init(BasicAWSCredentials);
// documents endpoint
serviceEndpoint = 'search-mydomain-myendpointstring.us-east-1.cloudsearch.amazonaws.com';
signingRegion = 'us-east-1';
@obxpete
obxpete / cfAWSSNSexample.cfc
Last active June 11, 2019 21:02
AWS SNS example in ColdFusion
BasicAWSCredentials = createObject("java", 'com.amazonaws.auth.BasicAWSCredentials').init(yourAccessKey, your
secretKey);
// turn credentials into a provider object
AWSCredentialsProviderObj = createObject("java", "com.amazonaws.auth.AWSStaticCredentialsProvider").init(BasicAWSCredentials);
// create our client
AWSSNSClient = createObject("java", "com.amazonaws.services.sns.AmazonSNSClientBuilder").standard().withRegion("us-east-1").withCredentials(AWSCredentialsProviderObj).build();
// create/identify the topicArn, snsMessage and snsSubject text strings of what you want your topic to publish.
@obxpete
obxpete / cfcomponent.sublime-snippet
Last active July 27, 2017 14:22 — forked from guitrspaz/cfcomponent.sublime-snippet
Creates a blank cfscript component
<snippet>
<content><![CDATA[/**
* @name: ${TM_FILENAME/(.+)\..+|.*/$1/:name}
* @hint: ${1}
* @author: $TM_FULLNAME ($TM_EMAIL)
* @copyright: $TM_ORGANIZATION_NAME
* @created: ${2}
* @modified: ${2}
*/
@obxpete
obxpete / cf - create crud from column names.sql
Last active October 9, 2017 13:53
coldfusion CRUD queries for existing table
--good for quick coding cruds
--- CF-specific. EDIT TO WORK WITH YOUR LANGUAGE
-- see http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f6f.html
-- for list of queryparam translations that might need to be done manually
declare @tablename varchar(50);
set @tablename = '[INSERT YOUR TABLE NAME HERE]';
/***
@obxpete
obxpete / me
Created July 25, 2017 19:46
me
<snippet>
<content><![CDATA[
Peter V Lombardo pete.lombardo@jhu.edu
]]></content>
<tabTrigger>me</tabTrigger>
</snippet>
@obxpete
obxpete / cfdao.returnID.sublime-snippet
Last active July 26, 2017 14:45 — forked from guitrspaz/cfdao.returnID.sublime-snippet
Creates a query function to return the resulting ID or other numeric value
<snippet>
<content><![CDATA[/**
* @name: ${TM_FILENAME/(.+)\..+|.*/$1/:name}.${1:functionName}
* @hint: ${2:Description}
* @returns: Numeric record ID
* @date: ${3:Date}
* @author: $TM_FULLNAME ($TM_EMAIL)
*/
${4:public} Numeric function ${1:functionName}(
${5}
@obxpete
obxpete / cfdao.returnQuery.sublime-snippet
Created July 25, 2017 17:56 — forked from guitrspaz/cfdao.returnQuery.sublime-snippet
Creates a query function that returns the query result
<snippet>
<content><![CDATA[/**
* @name: ${TM_FILENAME/(.+)\..+|.*/$1/:name}.${1:functionName}
* @hint: ${2:Description}
* @returns: Query
* @date: ${3:Date}
* @author: $TM_FULLNAME ($TM_EMAIL)
*/
${4:public} Query function ${1:functionName}(
${7}
@obxpete
obxpete / cfdao.returnRecordFound.sublime-snippet
Last active July 26, 2017 14:23 — forked from guitrspaz/cfdao.returnRecordFound.sublime-snippet
Query function to return a boolean value. Example use case: find if item exists.
<snippet>
<content><![CDATA[/**
* @name: ${TM_FILENAME/(.+)\..+|.*/$1/:name}.${1:functionName}
* @hint: ${2:Description}
* @returns: Boolean for whether a record exists
* @date: ${3:Date}
* @author: $TM_FULLNAME ($TM_EMAIL)
*/
${4:public} Boolean function ${1:functionName}(
${5}