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
'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
<%- cache(element) do -%> | |
<%= element_view_for(element) do |el| -%> | |
<div class="cta"> | |
<h3 class="cta-heading"> | |
<%= el.render :headline %> | |
</h3> | |
<%= el.render :description %> | |
<div class="cta-actions"> |
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"); | |
} | |
} |
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() { | |
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
class Contact < ActiveRecord::Base | |
has_many :users | |
has_many :friendships | |
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
<cfcomponent extends="Model"> | |
<cffunction name="init"> | |
<cfset table(false)> | |
</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
<cfcomponent extends="Model" output="false"> | |
<cffunction name="init" output="false"> | |
<cfscript> | |
hasMany(name="attemptedSolutions", shortcut="solution", dependent="delete"); | |
nestedProperties(association="attemptedSolutions", allowDelete=true, sortProperty="sortOrder"); | |
beforeValidation("$adjustAttemptedSolutionSortOrders"); | |
</cfscript> | |
</cffunction> | |
<cffunction name="$adjustAttemptedSolutionSortOrders" access="private" hint="Adjusts array of attempted solutions before save happens so there aren't any null entries." output="false"> |
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(){ |
NewerOlder