Skip to content

Instantly share code, notes, and snippets.

View tonyjunkes's full-sized avatar
🍺
Cheers

Tony Junkes tonyjunkes

🍺
Cheers
View GitHub Profile
<?xml version='1.0' encoding='utf-8'?>
<!-- The contents of this file will be loaded for each web application -->
<Context>
<!-- REWRITE VALVE -->
<Valve className="org.apache.catalina.valves.rewrite.RewriteValve" />
<!-- // -->
<!-- Speed up context loading -->
<JarScanner scanClassPath="false" />
<!-- Default set of monitored resources. If one of these changes, the -->
@tonyjunkes
tonyjunkes / nginx.conf
Last active February 3, 2017 19:33
Server portion for setting up a proxy to Lucee with rewrite to have index.cfm omitted for SES.
http {
...
server {
listen 80;
server_name mysite.local www.mysite.local;
root C:\websites\mysite\www;
index index.cfm;
<cfscript>
FORM.InputField = "<b>This</b> is some <em>string</em> text with <s>HTML</s> all up in it.";
example1 = reReplaceNoCase(FORM.InputField, "[^a-zA-Z\d\s:]", "", "ALL");
example2 = reReplaceNoCase(FORM.InputField, "<[^>]*>", "", "ALL");
writeDump("Example 1: " & example1);
writeOutput("<br>");
writeDump("Example 2: " & example2);
</cfscript>
component name="Watermark"
output="false"
{
public any function init() {
variables.AlphaComposite = createObject("java", "java.awt.AlphaComposite");
variables.Color = createObject("java", "java.awt.Color");
variables.Font = createObject("java", "java.awt.Font");
variables.jFile = createObject("java", "java.io.File");
variables.AffineTransform = createObject("java", "java.awt.geom.AffineTransform");
variables.ImageIO = createObject("java", "javax.imageio.ImageIO");
@tonyjunkes
tonyjunkes / example-with-linkedhashmap.cfm
Last active August 29, 2015 14:22
Blog Post: Keeping Order With Java's LinkedHashMap (With LinkedHashMap Example)
<cfscript>
// Some dummy articles yay!
articles = [
{title: "I Am a Title Perhaps", publishDate: createDate(2015, 11, 08)},
{title: "I Am a Title As Well", publishDate: createDate(2014, 08, 15)},
{title: "I Am a Title I Think", publishDate: createDate(2014, 09, 25)},
{title: "I Am a Title", publishDate: createDate(2013, 04, 05)},
{title: "I Am a Title Too", publishDate: createDate(2013, 05, 17)},
{title: "I Am a Title Also", publishDate: createDate(2013, 07, 02)}
];
@tonyjunkes
tonyjunkes / example-no-linkedhashmap.cfm
Last active August 29, 2015 14:22
Blog Post: Keeping Order With Java's LinkedHashMap (No LinkedHashMap Example)
<cfscript>
// Some dummy articles yay!
articles = [
{title: "I Am a Title Perhaps", publishDate: createDate(2015, 11, 08)},
{title: "I Am a Title As Well", publishDate: createDate(2014, 08, 15)},
{title: "I Am a Title I Think", publishDate: createDate(2014, 09, 25)},
{title: "I Am a Title", publishDate: createDate(2013, 04, 05)},
{title: "I Am a Title Too", publishDate: createDate(2013, 05, 17)},
{title: "I Am a Title Also", publishDate: createDate(2013, 07, 02)}
];
<cfscript>
set = {
one : {
alphabet : "a",
maori : "tahi",
roman : "i",
ordinal : "first"
},
two : {
@tonyjunkes
tonyjunkes / ckeditor-imagebrowser-example.js
Created November 22, 2013 23:00
CKEditor Image Browser addon setup example using ImageBrowser.cfc.
CKEDITOR.replace('textareaId', {
"extraPlugins": "imagebrowser",
"imageBrowser_listUrl": "/ImageBrowser.cfc?method=list&dir=/assets/images"
});
@tonyjunkes
tonyjunkes / example.json
Created November 22, 2013 22:24
CKEditor Image Browser addon JSON example data.
[
{
"image": "/image1_200x150.jpg",
"thumb": "/image1_thumb.jpg",
"folder": "Small"
},
{
"image": "/image2_200x150.jpg",
"thumb": "/image2_thumb.jpg",
"folder": "Large"
@tonyjunkes
tonyjunkes / ImageBrowser.cfc
Last active December 29, 2015 03:29
CFC for generating JSON data from a folder of images to be used with CKEditor's Image Browser addon.
component name="ImageBrowser"
output="false"
{
remote array function list(required string dir = "")
output="false"
returnformat="JSON"
{
var length = 0;
var path = var image = var folder = "";
var result = [];