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
<!-- read post from PayPal system and add 'cmd' --> | |
<CFSET str="cmd=_notify-validate"> | |
<CFLOOP INDEX="TheField" list="#Form.FieldNames#"> | |
<CFSET str = str & "&#LCase(TheField)#=#URLEncodedFormat(Form[TheField])#"> | |
</CFLOOP> | |
<CFIF IsDefined("FORM.payment_date")> | |
<CFSET str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#"> | |
</CFIF> | |
<CFIF IsDefined("FORM.subscr_date")> | |
<CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#"> |
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
SELECT table1.ID | |
FROM table1 | |
LEFT OUTER JOIN table2 ON table1.ID = table2.ID | |
WHERE table2.ID IS NULL |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<!-- Code source: http://www.devcurry.com/2009/08/limit-number-of-characters-in-textarea.html THANKS --> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Limit Number of Characters in a TextArea</title> | |
<script type='text/javascript' | |
src='http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js'></script> | |
<script type='text/javascript'> | |
$(document).ready(function() { |
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="normalizeChar" returntype="string" hint="Replaces characters with their non accented closest equivalents" output="true"> | |
<cfargument name="str" type="string" required="true" /> | |
<cfreturn ReplaceList( str,"á,é,í,ó,ú,ý,à,è,ì,ò,ù,â,ê,î,ô,û,ã,ñ,õ,ä,ë,ï,ö,ü,ÿ,À,È,Ì,Ò,Ù,Á,É,Í,Ó,Ú,Ý,Â,Ê,Î,Ô,Û,Ã,Ñ,Õ,Ä,Ë,Ï,Ö,Ü", | |
"a,e,i,o,y,u,a,e,i,o,u,a,e,i,o,u,a,n,o,a,e,i,o,u,y,A,E,I,O,U,A,E,I,O,U,Y,A,E,I,O,U,A,N,O,A,E,I,O,U") /> | |
</cffunction> | |
<cffunction name="normalizeColumn" returntype="query" output="true" hint="normalize single column and add new column [column]_norm"> | |
<cfargument name="qSource" type="query" required="true" /> | |
<cfargument name="column" type="string" required="true" /> | |
<cfset var normColumn = arguments.column & "_norm" /> |
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
void function structAppend2(required struct base, required string key, required any value) { | |
var paramStruct = {}; | |
paramStruct[arguments.key] = arguments.value; | |
structAppend(arguments.base,paramStruct); | |
} |
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
/** | |
* converts query to sturct map | |
* | |
* @param query source query to convert | |
* @param string key key for the main subkeys, when empty first column taken | |
* @return struct converted map | |
* | |
*/ | |
struct function toMap( required query source, required string key, string ignore="" ) { | |
var map = {}; |
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
/** | |
* Converts a coldfusion query into a coldfusion struct | |
* | |
* @param required query source query to convert | |
* @return struct converted query as a array with structs | |
*/ | |
array function toStruct( required query source) output="true" { | |
var arrResult = arraynew(1); | |
var cols = ListtoArray(arguments.source.columnlist); | |
var row = 1; |
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
require 'net/http' | |
def load_file(f_url) | |
load_content( URI.parse(f_url) ) | |
end | |
def load_content(uri) | |
resp = Net::HTTP.get_response(uri) | |
raise unless resp.code == "200" | |
write_file( get_filename(uri.to_s), resp.body) |
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
<!--- | |
Does a URL exist? Checks that host exists and for | |
404 status code. | |
http://www.forta.com/blog/index.cfm?mode=day&day=2&month=1&year=2006 | |
---> | |
<cffunction name="urlExists" output="no" returntype="boolean"> | |
<!--- Accepts a URL ---> | |
<cfargument name="u" type="string" required="yes"> | |
<!--- Attempt to retrieve the URL ---> |
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
<video width="640" height="360" controls> | |
<source src="__VIDEO__.MP4" type="video/mp4" /> | |
<source src="__VIDEO__.OGV" type="video/ogg" /> | |
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF"> | |
<param name="movie" value="__FLASH__.SWF" /> | |
<param name="flashvars" value="controlbar=over&image=__POSTER__.JPG&file=__VIDEO__.MP4" /> | |
<img src="__VIDEO__.JPG" width="640" height="360" alt="__TITLE__" | |
title="No video playback capabilities, please download the video below" /> | |
</object> | |
</video> |