Skip to content

Instantly share code, notes, and snippets.

View Thymeleaf Utility Objects
Expression Utility Objects
Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions.
#dates: utility methods for java.util.Date objects: formatting, component extraction, etc.
#calendars: analogous to #dates, but for java.util.Calendar objects.
#numbers: utility methods for formatting numeric objects.
#strings: utility methods for String objects: contains, startsWith, prepending/appending, etc.
#objects: utility methods for objects in general.
#bools: utility methods for boolean evaluation.
#arrays: utility methods for arrays.
KrunchMuffin / GraphicsMagick.cfm
Created February 24, 2022 19:10 — forked from JamoCA/GraphicsMagick.cfm
ColdFusion Custom Tag for GraphicsMagick. Faster than ColdFusion's CFImage/java processing. Smaller output files. Better CMYK compatibility. Works with more image formats. (Set timout=0 to have image manipulation performed in the background; 0ms)
View GraphicsMagick.cfm
NAME: CF_GraphicsMagick
DESCRIPTION: ColdFusion wrapper for some GraphicsMagick routines. Faster than CFImage. Generates smaller images. Better
CMYK compatilibity (Adds compatibility to CF9.)
Works with more images formats, including EPS:
<CF_GraphicsMagick action="AspectScale" Infile="#ImageIn#" Outfile="#imageOut#" width="#W#" height="#H#">
View nameInverter.js
const nameInverter = function(name) {
const honorifics = ['MR.', 'MRS.', 'MS.', 'DR.'];
switch (name) {
case '':
return '';
case undefined:
throw new Error('Name is undefined');
let newName = name.trim();
View findWaldo.js
// The second argument/parameter is expected to be a (callback) function
const findWaldo = function(names, found) {
names.forEach(e => {
if (e === 'Waldo') found();
const actionWhenFound = function() {
console.log('Found him!');
KrunchMuffin /
Created September 28, 2020 20:15 — forked from miraculixx/
a simple python based rule engine
(c) 2014 miraculixx at
from shrutil.dictobj import DictObject
class RuleContext(DictObject):
rule context to store values and attributes (or any object)
def __init__(self):
KrunchMuffin / days of week.txt
Created November 28, 2018 03:45
Days of the week for various languages
View days of week.txt
Javascript, PostgreSQL, PHP [$cal->setFirstDayOfWeek(IntlCalendar::DOW_SUNDAY);]
0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
SQL Server [SET DATEFIRST], ColdFusion, SQLite
7 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
Python [setfirstweekday()]
6 = Sunday, 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday, 5 = Saturday
KrunchMuffin / cfw.cfm
Created June 12, 2012 11:33
cfwheels help
View cfw.cfm
<!--- PetMEdicalCondition --->
<cfcomponent extends="Model" output="false">
<cffunction name="init" output="false" access="public">
<cfset belongsTo(name="pet", dependent="deleteAll")>
<cfset belongsTo(name="medicalcondition", dependent="deleteAll", joinType="outer")>
View twbootstrap.htm
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>KPI Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<!-- Le styles -->
<link href="../assets/css/jquery-ui-1.8.16.custom.css" rel="stylesheet">
KrunchMuffin / association.cfm
Created May 23, 2012 00:31
cfwheels association help
View association.cfm
<!--- pet model --->
<cfcomponent extends="Model" output="false">
<cffunction name="init" output="false" access="public">
<!--- relationships --->
<cfset hasOne(name="petProfile")>
<cfset hasMany(name="petDocuments", dependent="deleteAll")>
<cfset hasMany(name="personPets")>
<cfset hasMany(name="petEvents", dependent="deleteAll")>
<cfset hasMany(name="ViewPetEvents", foreignkey="petid")>