This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function foo (one, two) { | |
writedump(objectSave(duplicate(arguments))); | |
try { | |
writedump(objectsave(arguments)); | |
} catch (any e) { | |
writedump(e); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="setMinimumRequestTimeout" access="private" returntype="void" output="false"> | |
<cfargument name="timeout" type="numeric" required="true" /> | |
<cfscript> | |
var currentTimeout = 0; | |
try { | |
var requestMon = createObject("java", "coldfusion.runtime.RequestMonitor"); | |
currentTimeout = requestMon.getRequestTimeout(); | |
} catch (any e) { | |
//do nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias dps="docker ps -a" | |
alias dls="docker-machine ls" | |
alias dup="docker-machine start default && sleep 1 && denv" | |
alias ddown="docker-machine stop default" | |
alias dstart="denv && docker-compose up -d && dlogs" | |
alias drestart="denv && docker-compose restart && dlogs" | |
alias drestartapp="denv && docker-compose restart cf && dlogs" | |
alias dstop="denv && docker-compose stop && docker-compose rm -f" | |
alias denv='eval "$(docker-machine env default)"' | |
alias dexpose='docker-machine ssh default -vnNTL $(ipconfig getifaddr en0):9100:localhost:9100 -L $(ipconfig getifaddr en0):9101:localhost:9101' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name VARCHAR(50) -- database name | |
DECLARE @path VARCHAR(256) -- path for backup files | |
DECLARE @fileName VARCHAR(256) -- filename for backup | |
DECLARE @fileDate VARCHAR(20) -- used for file name | |
-- specify database backup directory | |
SET @path = 'C:\DBBackups\' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OS X | |
.DS_Store* | |
Icon? | |
._* | |
# Windows | |
Thumbs.db | |
ehthumbs.db | |
Desktop.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component { | |
function publicFunct (one) { | |
f(one); | |
} | |
function f (one, two=2) { | |
var anonF = function () { | |
writedump(var=variables, label="f() variables", expand=false); //no key for "one" or "two" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cffunction name="translateCfSqlType" access="public" returntype="string" output="false"> | |
<cfargument name="typeName" type="string" required="true" /> | |
<cfswitch expression="#arguments.typeName#"> | |
<cfcase value="bigint,int8,serial8"> | |
<cfreturn "cf_sql_bigint" /> | |
</cfcase> | |
<cfcase value="bigint identity"> | |
<cfreturn "cf_sql_bigint" /> | |
</cfcase> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component accessors="true" { | |
property numeric foo setter="false"; | |
/* | |
Invalid definition for Property. | |
Property must be defined first within component declaration. | |
*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
function kthPercentile (k, data) { | |
if (k > 1) { //this allows users to pass in .99 or 99 | |
k = k / 100; | |
} | |
arraySort(data, "numeric"); | |
var kth = k * arrayLen(data); | |
if (kth == ceiling(kth)) { //its a whole number | |
return data[kth]; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cffunction name="getQRCodeURL" access="remote" returntype="string" output="false"> | |
<cfargument name="data" type="string" required="true" /> | |
<cfargument name="size" type="numeric" required="true" /> | |
<cfset var baseURL = "https://chart.googleapis.com/chart?cht=qr" /> | |
<cfreturn baseURL & "&chs=" & arguments.size & "x" & arguments.size & "&choe=UTF-8&chld=H|1&chl=" & urlencodedFormat(arguments.data,"UTF-8") /> | |
</cffunction> |