Skip to content

Instantly share code, notes, and snippets.

View atuttle's full-sized avatar

Adam Tuttle atuttle

View GitHub Profile
@atuttle
atuttle / cfstack.js
Last active June 12, 2026 13:53
CFStack Raycast script command - filter CFML stack traces down to just the CFML files (ignore all of the java crap)
#!/usr/bin/env node
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title CFML Stack Trace Filter
// @raycast.mode silent
// Optional parameters:
// @raycast.icon 🤖
// @raycast.packageName cfstack
@atuttle
atuttle / cfstack
Last active June 12, 2026 13:52
CFStack: CLI utility for trimming down a CFML stacktrace to just the bits you want to dump into an LLM to make it fix the error.
#!/usr/bin/env node
/*
Run it bare and it will prompt you to paste a stack trace,
or feed it the stack trace from stdin and copy from stdout
hint: pbpaste | cfstack | pbcopy
*/
'use strict';
@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
@atuttle
atuttle / gist:4127365
Last active April 25, 2024 02:43 — forked from learncfinaweek/gist:4121263
Application.cfc

By now you've learned the basics of ColdFusion, script vs. tag syntax, scopes, how to deal with data, and even some code-reuse techniques. You're now able to write something useful, so it's time we introduce you to the Request Lifecycle.

You see, when someone requests a ColdFusion page, CF doesn't just start executing your code. There are several events that first take place, which you can be waiting for, and to which you can react. This is not strictly necessary, but you'll find that any complex application will eventually want to make use of some or all of these features, so it's best that you know about them. In order to react to these events, you need to have an Application.cfc file. ColdFusion has designated Application.cfc as a special component that it will automatically look for, and in which we can put our event listeners for request lifecycle events.

A Note on Terminolog
@atuttle
atuttle / timezones.cfm
Last active November 19, 2022 03:23
Dealing with Time Zones in ColdFusion
<!---
Many thanks to Sean Corfield and Ryan Guill who set me down the correct path of java.util.TimeZone
--->
<cfscript>
writeDump(label="Conversion Examples",var={
"0-local-tz": getSystemTZ()
,"1-local-now": now()
,"2-utc-now": toUTC(now())
,"3-eastern-now": TZtoTZ( getSystemTZ(), now(), "America/New_York" )
@atuttle
atuttle / Amazon S3 Upload.cfm
Created January 28, 2013 19:11
Upload files to Amazon S3 with ColdFusion. This is heavily based on code from Joe Danziger's s3.cfc: http://amazons3.riaforge.org/
<cffunction name="uploadToAmazonS3">
<cfargument name="fileName" required="true" />
<cfargument name="contentType" required="true" />
<cfargument name="data" required="true" />
<cfargument name="acl" default="public-read" />
<cfargument name="storageClass" default="STANDARD" />
<cfargument name="HTTPtimeout" default="300" />
<cfargument name="bucket" default="#getProperty('EmailAttachmentS3Bucket')#" />
<cfargument name="accessKeyId" default="#getProperty('EmailAttachmentS3AccessKeyId')#" />
<cfargument name="secretKey" default="#getProperty('EmailAttachmentS3SecretKey')#" />
// test/unit/services/SecurityFilterService
describe("Tests for SecurityFilterService", () => {
describe("Tests for isAuthorised", () => {
it("will reject a user that is not authorised to access the resource", () => {
service = new SecurityFilterSerivce() // might need mocked dependencies
result = service.isAuthorised("juniorUser", "/email/approve-copy", "patch")
expect result.toBeFalse()
})
// Menu: Run the Tutorial
// Description: Learn the basics of using Script Kit
// Author: John Lindquist
// Twitter: @johnlindquist
await cli(
"new",
"--template",
"tutorial",
"--message",

How to make an annual plan

Notes from this video by Jack Conte, CEO of Patreon (and member of band Pomplamoose, which I mention only because it's relevant to the video.)

Why?

  • Gives you a greater ability to focus on what matters
  • Helps you understand what you want and how to get it
  • Let's you live your dream

An annual plan consists of:

Working Code Podcast Patron Discord Code of Conduct

Welcome!

The Working Code Podcast Discord is a place for Patrons of the Working Code Podcast to chat about the podcast and anything else they want (within the reasonable limits outlined here).

The current admins are:

  • Adam Tuttle