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
<?php | |
function build_banner_class(int $age) : array { | |
$banner_class = ['banner']; | |
if ($age >= 21) { | |
$banner_class[]= 'banner--boogie'; | |
} | |
$banner_class = array_merge($banner_class, [ | |
"color-$color", |
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
<cffunction | |
name="autoLink" | |
returntype="string" | |
access="public" | |
output="false" | |
hint="Turns all URLs and e-mail addresses into clickable links." | |
examples=' | |
##autoLink("Download Wheels from http://cfwheels.org/download")## | |
-> Download Wheels from <a href="http://cfwheels.org/download">http://cfwheels.org/download</a> |
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
<!--- URL to RSS feed ---> | |
<cfparam name="arguments.articlesRss" type="url"> | |
<!--- URL to Delicious page ---> | |
<cfparam name="arguments.articlesUrl" type="url"> | |
<!--- Number of items to display from feed ---> | |
<cfparam name="arguments.numToDisplay" type="numeric" default="10"> | |
<!--- Note: we are breaking the convention of data access in the view here so that we can cache this partial ---> | |
<cfset articles = articles(arguments.articlesRss)> | |
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
'use strict'; | |
exports.handler = (event, context, callback) => { | |
const request = event.Records[0].cf.request; | |
let uri = request.uri ? request.uri : '/'; | |
if (request.querystring) { | |
uri += '?' + request.querystring; | |
} | |
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 extends="Model" { | |
function init() { | |
table(false); | |
// Set property labels for form fields and related error messages. | |
property(name="startDate", label="Start"); | |
property(name="endDate", label="End"); | |
//... | |
} |
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
adapter: sftp | |
host: | |
port: | |
username: | |
password: | |
path: | |
additional: | |
- css/app.min.css | |
- javascripts/app.min.js |
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
<form action="action.cfm" method="post"> | |
<p> | |
<strong>Your Name</strong><br /> | |
<input type="text" name="yourName" /> | |
</p> | |
<p> | |
<strong>Gender</strong><br /> | |
<input type="radio" name="gender" value="M" /> | |
Male<br /> | |
<input type="radio" name="gender" value="F" /> |
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
<cfoutput> | |
<!--- Instead of a lame check like `<cfif get("environment") eq "production">`, | |
we can instead do whatever the environment is calling for ---> | |
<cfif | |
StructKeyExists(server.ENV, "GOOGLE_ANALYTICS_TRACKING_CODE") | |
and Len(server.ENV.GOOGLE_ANALYTICS_TRACKING_CODE) | |
> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
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
<h1> | |
<a href="/posts/fart"><script>>alert('All your base are belong to us!');</script></a> | |
</h1> | |
<p class="post-meta"> | |
<script>sendCookieInfoToAnotherServer = function() { /* ... */ }; sendCookieInfoToAnotherServer();</script> | |
</p> | |
<h2>Banana Comments</h2> |
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 extends="Model" { | |
function init() { | |
belongsTo("contact"); | |
} | |
} |
NewerOlder