This file contains hidden or 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
This is ColdFusion 10 Beta cumulative hotfix 2. | |
It includes fix for Bug ID 3117366(issue with implicit getters throwing error when they are called from inside cfc | |
corresponding cfproperty is not initialized). | |
Once the fix is installed, even without initialization of cfproperty, implicit getters can be called on it. |
This file contains hidden or 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> | |
public void function testStringsShouldBeEqual(){ | |
var result = "Foo"; | |
//in the koans __ represents a value that you need to fill in to make the test return true | |
//in some cases you'll want to keep the "" and in some you wont (see next example) | |
assertEquals(result,"__"); | |
} | |
</cfscript> |
This file contains hidden or 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> | |
public Struct function extend() | |
output=false hint="I take structs and add their keys"{ | |
var ret = {}; | |
for(var i = 1; i <= arrayLen(arguments); i++){ | |
for(key in arguments[i]){ | |
ret[key] = arguments[i][key]; | |
} | |
} |
This file contains hidden or 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> | |
public Array function list(Struct options = {}) | |
output=false hint="I return a list of active, non-deleted people by default."{ | |
//create our default options | |
var defaults = { | |
deleted = false, | |
active = true | |
}; | |
//now combine this struct with the options |
This file contains hidden or 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> | |
//returns all active, non-delted people | |
list(); | |
//returns only active, non-deleted people | |
list({active = false}); | |
//returns only inacvie, delted people | |
list({active = false, deleted = true}); |
This file contains hidden or 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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
function flatten(obj,prefix){ | |
var propName = (prefix) ? prefix + '.' : '', | |
ret = {}; | |
for(var attr in obj){ | |
if(_.isArray(obj[attr])){ | |
var len = obj[attr].length; | |
ret[attr] = obj[attr].join(','); |
This file contains hidden or 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
/** | |
* @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator | |
*/ | |
component extends="Koans.BaseKoan" { | |
private boolean function isTruthy(Any myVar){ | |
if(isBoolean(arguments.myVar)){ | |
return (arguments.myVar) ? true : false; | |
} |
This file contains hidden or 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
displayMessage: function(ev){ | |
var id = ev.currentTarget.id, | |
dfd = $.Deferred(), | |
self = this, | |
statusCell = this.getStatusCell($(ev.currentTarget)); | |
this.model.set('id',id); | |
if(statusCell.find('img').attr('alt') === 'unread'){ |
This file contains hidden or 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> | |
//stubbing | |
public void function testSavingPerson() | |
output=false hint=""{ | |
//create the mock of your dao | |
var mockPersonDAO = mock("PersonDAO","typeSafe"); | |
//tell the mock that when save is called with the cut to return void | |
mockPersonDAO.save(variables.Person).returns(); | |
//add it to the cut |