Skip to content

Instantly share code, notes, and snippets.

View jeremyhalliwell's full-sized avatar

Jeremy Halliwell jeremyhalliwell

View GitHub Profile
<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 );
<cfscript>
arr = [
'foo','foo','bar','baz','foo'
];
filteredArr = arr.reduce( ( result=[],item ) => {
return result.find( item )? result: result.append( item );
});
dump( filteredArr );
arr = [
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,