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> | |
public string function cleanContentWithSafeList( required string content ) { | |
var doc = jsoup().parse( content ); | |
var allowedAttributes = [ "class" ]; | |
var allowedAdditionalTags = [ "audio","video" ]; | |
var safeList = this.getJsoupWrapper().newSafelist() | |
.relaxed() // 'relaxed' allows a full range of text and structural body HTML | |
.addTags( JavaCast( "string[]",allowedAdditionalTags ) ) | |
.addAttributes( ":all",JavaCast( "string[]",allowedAttributes ) ); | |
var result = jsoup().clean( doc,safeList ); |
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> | |
arr = [ | |
'foo','foo','bar','baz','foo' | |
]; | |
filteredArr = arr.reduce( ( result=[],item ) => { | |
return result.find( item )? result: result.append( item ); | |
}); | |
dump( filteredArr ); | |
arr = [ |
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 hint="wrapper for Salesforce REST 2.0 API" { | |
pageEncoding "utf-8"; | |
/** | |
Copyright (C) 2012 Daniel Watt | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, |