Skip to content

Instantly share code, notes, and snippets.

@learncfinaweek
learncfinaweek / gist:4121146
Created November 20, 2012 21:10
Data Handling - Hands On 11

In this hands on, we are going to generate an XML sitemap that is formatted for use with Google Sitemaps.

Tags Used: <cfxml>, <cfoutput>, <cffile>

Functions Used: toString

@learncfinaweek
learncfinaweek / gist:4121237
Created November 20, 2012 21:22
Code Reuse - Hands On 12

In this hands on, let's create a function that will take a string and output a string of ASCII characters. Some people think that this will stop email addresses from being spidered. This may or may not be the case, but the logic for creating a function is still the same.

Tags Used: <cfscript>, <cffunction>, <cfargument>, <cfset>, <cfloop>,

@learncfinaweek
learncfinaweek / gist:4121250
Created November 20, 2012 21:23
Code Reuse - Hands On 14

In this hands on, we will create a custom tag that will handle the display of the header and footer.

Tags Used: <cfif>, <cfelse>, <cfset>, <cfimport>

  1. Create a folder called customTags in the /www/ folder.
@learncfinaweek
learncfinaweek / gist:4121271
Created November 20, 2012 21:26
OOP - Hands On 17

In this Hands On we are going to create an encapsulated cfc that holds error data.

Functions Used: ArrayAppend, ArrayLen

  1. Create a new file called errorBean in the /www/admin/cfc/ folder.
@learncfinaweek
learncfinaweek / gist:4121285
Created November 20, 2012 21:28
ORM - Hands On 19

In this hands on example, you are going to add the list and create functionality in the Admin for the blog posts and categories.

Tags Used: <cfset>

Functions Used: EntityLoad, EntityNew, now

@learncfinaweek
learncfinaweek / gist:4121293
Created November 20, 2012 21:29
ORM - Hands On 21

In this hands on, we are going to add categories to blog posts. The logic for this involves creating a linking entity to which both the blog post and category will be associated. This is an alternative method to using a many-to-many relationship.

Tags Used: <cfloop>, <cfset>

Functions Used: EntitySave, for,

@learncfinaweek
learncfinaweek / gist:4121308
Created November 20, 2012 21:31
Document Handling - cfhttp

cfhttp makes HTTP calls from your ColdFusion server to an internet address of your choice. It is important to remember that it is the ColdFusion server that will be calling the URL, not the browser that is calling your ColdFusion page. Think of cfhttp as if you have proxy browser on your server that can send and receive information to any address on the internet. Imagine that this "virtual browser" on the server can save the information that it receives to a variable, so that it can be manipulated or passed to the user who has called your ColdFusion page.

Making a HTTP call

There are many attributes that the cfhttp tag can take. The simplest cfhttp call can be done like this:

@learncfinaweek
learncfinaweek / gist:4121341
Created November 20, 2012 21:36
Document Handling - Hands On 23

In this hands on example, you are going to make a call to Twitter to get a list of your latest tweets and output them to the contact page.

Tags Used: <cfhttp>, <cfloop>, <cfoutput>

Functions Used: dateFormat

@learncfinaweek
learncfinaweek / gist:4121349
Created November 20, 2012 21:37
Document Handling - Hands On 25
@learncfinaweek
learncfinaweek / gist:4121364
Created November 20, 2012 21:40
Security - Introduction

Security is a broad topic area and the threats are constantly evolving. Security encompasses more than just writing secure code, but also items like the configuration and setup of the servers and network, and practices and procedures for handling sensitive data.

In this chapter, we'll focus on areas of security that you have the most control over as a ColdFusion developer in order to help you write more secure ColdFusion code and understand the security settings in the ColdFusion Administrator, making it more difficult for an attacker to exploit your web application. We say "more difficult" because no web application can be 100% secure.

There are several shifts in thought required.