Skip to content

Instantly share code, notes, and snippets.

@bdw429s
bdw429s / slackFileDelete.cfc
Last active May 22, 2018 11:01
This is a CommandBox Task Runner that will delete file from your Slack team that are older than 30 days. Please see the first comment for usage instructions.
/**
* Delete Slack files older than 30 days
*/
component {
function run( token='', user='' ) {
if( !token.len() ) {
error( 'Need an API token provided. Edit this task or pass it as ":token=foobar".' );
}
@reborg
reborg / rich-already-answered-that.md
Last active July 11, 2024 09:54
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@mikob
mikob / AWS, ELB, CF and Let's Encrypt
Last active June 2, 2024 02:55
AWS, ELB, Let's Encrypt
Elastic Load Balancer, CloudFront and Let's Encrypt
<cffunction name="translateCfSqlType" access="public" returntype="string" output="false">
<cfargument name="typeName" type="string" required="true" />
<cfswitch expression="#arguments.typeName#">
<cfcase value="bigint,int8,serial8">
<cfreturn "cf_sql_bigint" />
</cfcase>
<cfcase value="bigint identity">
<cfreturn "cf_sql_bigint" />
</cfcase>
@JamoCA
JamoCA / GraphicsMagick.cfm
Last active March 25, 2023 08:37
ColdFusion Custom Tag for GraphicsMagick. Faster than ColdFusion's CFImage/java processing. Smaller output files. Better CMYK compatibility. Works with more image formats. (Set timout=0 to have image manipulation performed in the background; 0ms)
<CFSETTING ENABLECFOUTPUTONLY="YES">
<!---
NAME: CF_GraphicsMagick
DESCRIPTION: ColdFusion wrapper for some GraphicsMagick routines. Faster than CFImage. Generates smaller images. Better
CMYK compatilibity (Adds compatibility to CF9.)
Works with more images formats, including EPS: http://www.graphicsmagick.org/formats.html
EXAMPLES:
<CF_GraphicsMagick action="AspectScale" Infile="#ImageIn#" Outfile="#imageOut#" width="#W#" height="#H#">
(ns creator.handler
(:require [compojure.core :refer :all]
[compojure.handler :as handler]
[compojure.route :as route]
[ring.middleware.params :refer [wrap-params]]
[hiccup.page :refer [html5 include-css include-js]]
[clojure.data.json :as json]
[ring.util.codec :refer [base64-encode]])
(:import (javax.crypto Mac)
(javax.crypto.spec SecretKeySpec)
@ryanguill
ryanguill / pbkdf2.cfm
Last active June 21, 2018 15:29
PBKDF2 in CF: This is an example and test of hashing passwords in CFML using PBKDF2. Save this file as pbkdf2.cfm and run it for more information.
<cfscript>
struct function hashPasswordPBKDF2 (required string password, numeric iterations = 10000, numeric saltByteLength = 8) {
if (iterations < 100000) {
throw(message="Iterations must be greater than or equal to 100000");
}
if (saltbytelength < 8) {
throw(message="SaltByteLength must be greater than or equal to 8");
}