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 getUploadData() { | |
var local = {}; | |
local.result = {}; | |
if (cgi.request_method Eq 'post') { | |
local.uploads = form.getPartsArray(); | |
if (StructKeyExists(local, 'uploads')) { | |
local.count = ArrayLen(local.uploads); | |
for (local.u = 1; local.u Lte local.count; local.u++) { | |
local.info = GetFileInfo(form[local.uploads[local.u].getName()]); |
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="sessionStop" output="false"> | |
<cfset var local = StructNew() /> | |
<cfif Not StructKeyExists(application, 'applicationName')> | |
<cfthrow message="Application.applicationName is missing." /> | |
</cfif> | |
<cftry> | |
<cfset local.sid = session.cfid & '_' & session.cftoken /> | |
<cfset local.jTracker = CreateObject('java', 'coldfusion.runtime.SessionTracker') /> | |
<cfset local.jTracker.cleanUp(application.applicationName, local.sid) /> | |
<cfcatch type="any"> |
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="ApplicationStop" returntype="boolean" output="false"> | |
<cfif IsDefined('application')> | |
<cftry> | |
<!--- This is just in case there's no app scope but variables.application ---> | |
<cfset CreateObject('java', 'coldfusion.runtime.ApplicationScopeTracker').cleanUp(application) /> | |
<cfreturn true /> | |
<cfcatch type="any"></cfcatch> | |
</cftry> | |
</cfif> | |
<cfreturn false /> |
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="ApplicationRestart" returntype="boolean" output="false"> | |
<cfif IsDefined('application')> | |
<cftry> | |
<!--- This is just in case there's no app scope but variables.application ---> | |
<cfset application.setIsInited(false) /> | |
<cfreturn true /> | |
<cfcatch type="any"></cfcatch> | |
</cftry> | |
</cfif> | |
<cfthrow message="No application scope found." /> |
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 output="false"> | |
<cffunction name="init" access="public" output="false"> | |
<cfscript> | |
var local = {}; | |
variables.jObject = CreateObject('java', 'some.java.object.with.set.Methods').init(); | |
variables.methods = {}; | |
local.methods = variables.jObject.getClass().getMethods(); | |
local.len = ArrayLen(local.methods); |
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> | |
start = Now(); | |
/* | |
=== Session Logger === | |
== ChangeLog == | |
* More config options. | |
* Supports CREATED, ACCESSED, UPDATED, REMOVED. | |
* Detects changes in the log keys and redisplays in log if changed. | |
* Windows newline ending, configurable. |
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
// Bookmarklet to alter Redmine theme to look like twitter bootstrap | |
// Only a concept to test the design | |
// Suggest you minify first (removing comments), before bookmarking | |
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.7.2",function($,L){ | |
// BEGIN | |
$(function() { | |
$('link[rel=stylesheet]').remove(); | |
$('head') |
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
$('input[type=text],textarea').each(function() {$(this).val(Math.random().toString(36).substring(3))}); | |
$('select').each(function() { | |
var el = this; | |
if (el.multiple) { | |
$('option', el).each(function() { | |
this.selected = (Math.random() > 0.5); | |
}); | |
} 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
javascript:(function(){$('.gist .line br').each(function(){if($(this).siblings().length==0){$(this).parent().remove();}});$('.c, .cm, .c1, .cs','.gist').each(function(){var el=$(this);var parent=el.parent();if(el.siblings().length > 0){var comment=parent.attr('data-comment');comment=(typeof comment==='undefined')%3F'':(comment+'\n');parent.attr('data-comment',comment+el.text());el.remove();}else{var nextParent=parent.next();var comment=parent.attr('data-comment');comment=(typeof comment==='undefined')%3F'':(comment+'\n');nextParent.attr('data-comment',comment+el.text());parent.remove();}});$('html > head').append('<style>*[data-comment] {position:relative; background-color:%23dfd;} *[data-comment]:hover {background-color: %23efe;} *[data-comment]:after, *[data-comment]:before {content:""; opacity:0; z-index:999;} *[data-comment]:hover:after, *[data-comment]:focus:after {opacity:0.94; display:block; content:attr(data-comment); position:absolute; bottom:25px; padding:3px; background:%23efe; border:2px solid %23 |
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 output="false"> | |
<cffunction name="onError"> | |
<cfargument name="exception" required="true" /> | |
<cfargument name="eventName" type="string" required="true" /> | |
<cfif StructKeyExists(arguments.exception, 'rootcause') | |
And StructKeyExists(arguments.exception.rootCause, 'type') | |
And arguments.exception.rootCause.type Eq 'coldfusion.runtime.AbortException'> | |
<!--- CF7: Work around for CfAbort and CfLocation causing this to run ---> | |
<cfreturn /> | |
</cfif> |
OlderNewer