Skip to content

Instantly share code, notes, and snippets.

<cfscript>
param variables.foo = "";
writedump(variables);
/*
Railo 4.2.1.007 Error (template)
Message Invalid Identifier, the following character cannot be part of a identifier [=]
Stacktrace The Error Occurred in
E:\home\html\railo-test\param-test-2605.cfm: line 2
<cfscript>
/**
* Displays a formatted approximation of how long ago a timestamp was.
*
* @param input - Date to Format (required)
* @param defaultMask - the date mask if the date is earlier than the earliest case. Default dd MMM, YYYY
* @return Returns a string.
* @author Ryan Guill (ryanguill@gmail.com), Adam Tuttle (adam@fusiongrokker.com)
* @version 1, Sept 11, 2014
/*
This CFC is intended to be used with fw/1 and stored in the session scope.
session.flash = beanFactory.getBean("FlashStorage"); //if you are using fw/1
or
session.flash = FlashStorage();
it is inteneded to be used to store any variables you would like to hold on
<cfscript>
a = function () {
return true;
};
b = function () {
return true;
};
@ryanguill
ryanguill / 0_reuse_code.js
Last active August 29, 2015 14:08
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
<cfscript>
writedump(parsedatetime("Wed, 05 Nov 2014 20:22:51 GMT"));
writedump(now());
</cfscript>
<cfscript>
//http://blog.adamcameron.me/2014/11/something-for-weekend-wee-code-quiz-in.html
function getSubseries(required array series, required numeric threshold) {
if (series.len() == 0) {
return series;
}
var candidates = [];
<cfscript>
function getData_works (ID) {
var data = queryNew("ID","Integer");
queryAddRow(data);
querySetCell(data, "ID", 1);
//this works fine
return queryExecute("SELECT * FROM data where ID = :ID", {ID: ID}, {dbtype="query"});
}
<html>
<head>
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<script>
var set = {
one : {
alphabet : "a",
IF EXISTS ( SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[tablename]') AND name = N'tablename_IDX0')
BEGIN
DROP INDEX tablename_IDX0 ON tablename;
END
CREATE NONCLUSTERED INDEX tablename_IDX0 ON tablename
(
columnA
)
INCLUDE