View gist:4614fd933bb7b9e9fc05f56f1e9274a7
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
<cfprocessingdirective pageencoding="utf-8"> | |
<cfheader name="Content-Disposition" value="attachment; filename=myworddoc.doc" charset="utf-8"> | |
<cfcontent type="application/msword; charset=utf-8"> | |
<html xmlns:o="urn:schemas-microsoft-com:office:office" | |
xmlns:w="urn:schemas-microsoft-com:office:word" | |
xmlns="http://www.w3.org/TR/REC-html40"> | |
<head> | |
<style> | |
<!--[if gte mso 9]> |
View gist:77f8dbc750cca35caa8d7062f7592150
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
public string function getIPAddress() { | |
local.rv = ""; | |
try { | |
try { | |
local.headers = getHttpRequestData().headers; | |
if (structKeyExists(local.headers, "X-Forwarded-For") && len(local.headers["X-Forwarded-For"]) > 0) { | |
local.rv = trim(listFirst(local.headers["X-Forwarded-For"])); | |
} | |
} catch (any e) {} | |
if (len(local.rv) == 0) { |
View gist:cd54c870007845fd500e7c624d1b9a63
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
// If a plugin has a jar or class file, automatically add the mapping to this.javasettings. | |
this.wheels.pluginDir = this.wheels.rootPath & "plugins"; | |
this.wheels.pluginFolders = DirectoryList(this.wheels.pluginDir, "true", "path", "*.class|*.jar|*.java"); | |
for (this.wheels.folder in this.wheels.pluginFolders) { | |
if(!structKeyExists(this, "javaSettings")){ | |
this.javaSettings={}; | |
} | |
if(!structKeyExists(this.javaSettings, "LoadPaths")){ |
View gist:a375b54a24ff79c5ec3dcac182c9c3aa
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="tests.Test" hint="Unit Tests" { | |
function setup(){ | |
super.setup(); | |
params = {controller="dummy", action="dummy"}; | |
loc.controller = controller("dummy", params); | |
} | |
function teardown(){ | |
super.teardown(); | |
} |
View Test.cfc
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="wheelsMapping.Test" hint="Unit Tests" { | |
include "../wheels/test.cfm"; | |
function setup(){ | |
} | |
function teardown(){ | |
} | |
} |
View Locations.cfc
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="app.controllers.Controller" hint="Locations Controller" | |
{ | |
// Name of your model: | |
this.modelName="location"; | |
// Optional nested properties to include: | |
// this.includeNestedProperties = "somethign"; | |
function config() { | |
super.config(); | |
} | |
function index(){ |
View index.cfm
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
<cfscript> | |
products = [ | |
{"sku": "prod_one", "title": "Product One"}, | |
{"sku": "prod_two", "title": "Product Two"}, | |
{"sku": "prod_three", "title": "Product Three"}, | |
{"sku": "prod_four", "title": "Product Four"} | |
]; | |
skuToFind="prod_two"; |
View gist:c0603a6eec2187401050049d68d91dc9
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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
watch: { | |
sass:{ |
View routes.cfm
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
mapper() | |
.resources("users") | |
.root(to="wheels##wheels", method="get") | |
.end() |
View routes.cfm
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
addRoute(name="users", pattern="/users/[action]/[key]", controller="users"); | |
addRoute(name="users", pattern="/users/[action]/", controller="users"); | |
addRoute(name="users", pattern="/users/", controller="users", action="index"); |
NewerOlder