Skip to content

Instantly share code, notes, and snippets.

View atuttle's full-sized avatar

Adam Tuttle atuttle

View GitHub Profile

https://bugbase.adobe.com/index.cfm?event=bug&id=3525456

Here's a simple repro case. Since this test involves ORM, you'll have to create a DSN. I'm testing against MySQL but it should be DB agnostic (that's part of the draw of ORM, right?)...

Just create a database and a new DSN named "repro" (or update the code accordingly), put foo.cfc into a folder named "orm", and everything else should work as expected.

@atuttle
atuttle / Default (OSX).sublime-keymap
Created August 8, 2014 18:17
My Sublime Text 3 Preferences and Keymaps
[
{ "keys": ["alt+up"], "command": "swap_line_up" }
,{ "keys": ["alt+down"], "command": "swap_line_down" }
,{ "keys": ["ctrl+alt+down"], "command": "duplicate_line" }
,{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} }
,{
"keys": ["ctrl+alt+left"],
"command": "set_layout",
"args": {
@atuttle
atuttle / ACF_custom_errors_partial_match.cfm
Last active August 29, 2015 14:05
This file demonstrates that ACF (Tested on latest patched CF10) does allow for "partial matching" of custom-typed thrown exceptions.
<cfscript>
try {
throw(type="com.myService.BarException");
} catch(com.myService.FooException e){
writeOutput("caught it @ com.myService.FooException");
@atuttle
atuttle / ptw_links.md
Last active August 29, 2015 13:57
Relevant links for my Philly Tech Week 2014 talk: Integrate ALL the Things!
@atuttle
atuttle / api.js
Created February 4, 2014 14:31
Angular.js REST API Service Wrapper
app.factory('API', function($http, $q){
var basePath = 'http://domain.com/api/path';
// => http://domain.com/api/path/foo/bar
function makeRequest(verb, uri, data){
var defer = $q.defer();
verb = verb.toLowerCase();
//start with the uri
RewriteLog C:\Inetpub\ATuttle\meta_files\fusiongrokker.com\iirfLog.out
RewriteLogLevel 0
RewriteFilterPriority HIGH
###### force removal of www. prefix on all requests
RewriteCond %{HTTP_HOST} www.fusiongrokker.com(.*) [I]
RewriteRule ^/(.*) http://fusiongrokker.com/$1 [I,R=301,U,L]
###### fix old links
@atuttle
atuttle / nester.cfc
Last active December 24, 2015 22:09
ColdFusion 10 Closure Nesting example
component {
public string function publicMethod (String name, member=0) {
local.localVar = member + 5;
local.localVarOuter = local.localVar;
local.localVar2 = "outer: #name#";
return function() {
local.localVar = "zxcv";
return function() {
@atuttle
atuttle / _.md
Last active December 21, 2015 05:09
<cfscript>
original = fileRead(expandPath("./src.html"), "UTF-8");
encoded = encodeForHTML(original);
function htmlDecode(HTML){
return replaceList(arguments.HTML, "&lt;,&gt;,&amp;,&quot;", '<,>,&,"');
}
decoded = htmlDecode(encoded);
component {
this.contains = function(){
writeOutput("Hi from ScriptBased.contains()<br>");
};
}