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
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. |
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
<CFSETTING ENABLECFOUTPUTONLY="YES"> | |
<!--- | |
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: http://www.graphicsmagick.org/formats.html | |
EXAMPLES: | |
<CF_GraphicsMagick action="AspectScale" Infile="#ImageIn#" Outfile="#imageOut#" width="#W#" height="#H#"> |
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
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(); |
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
// 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!'); | |
}; |
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
""" | |
(c) 2014 miraculixx at gmx.ch | |
""" | |
from shrutil.dictobj import DictObject | |
class RuleContext(DictObject): | |
""" | |
rule context to store values and attributes (or any object) | |
""" | |
def __init__(self): |
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
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()] | |
date.weekday | |
6 = Sunday, 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday, 5 = Saturday | |
date.isoweekday() |
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
<!--- 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")> | |
</cffunction> | |
</cfcomponent> |
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> | |
<html lang="en"> | |
<head> | |
<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"> |
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
<!--- 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")> |