Skip to content

Instantly share code, notes, and snippets.

View spillsthrills's full-sized avatar

Robb Mills spillsthrills

  • 02:28 (UTC -05:00)
View GitHub Profile
@spillsthrills
spillsthrills / queryServiceWrapperPOC.cfm
Last active August 6, 2021 21:50
Query Service Wrapper Proof of Concept
<cfscript>
//try to force update on tryCF
private struct function results( struct optionalReturnKeys={} ) {
var result = {
errors : [],
success : false
};
return result.append(arguments.optionalReturnKeys);
}
@spillsthrills
spillsthrills / publickey-git-error.markdown
Created February 26, 2021 20:27 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th

AWS Fargate Docker Simple Deployment Setup with SSL termination

How to:

  • create a Docker-based AWS Fargate/ECS deployment
  • without the Docker containers having a public IP
  • with an Application Load Balancer as reverse proxy / SSL termination proxy sitting in front of the containers

For Fargate/ECS to be able to access your Docker images hosted on ECR (or somewhere else) you'll have to allow outbound internet access to the Fargate subnets. Here's how you do it.

@spillsthrills
spillsthrills / gist:31c033e385daff7bee343fdfb7bf0a21
Last active October 1, 2020 17:20
cfscript query return struct MySQL format
public struct function readTable(required numeric id) {
var response = {
data:"",
recordCount:0,
errorMsg:""
};
var params = {};
var qryRes = {};
@spillsthrills
spillsthrills / ConstrainedTypesExamples.fsx
Last active September 30, 2020 10:01 — forked from swlaschin/ConstrainedTypesExamples.fsx
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").
<cfscript>
/*
//*********************** Tests ******************************
orig Struct = {itemA_1:1,itemA_2:2,itemA_3:"Question Mark=?",itemA_4:""};
//newStruct = {itemB_1:1,itemB_2:2,itemA_2:5};
newStruct = {
'utm_source' : 'Craigslist',
'utm_campaign' : 'cpc',
<cfscript>
public struct function queryStringToStruct(
required string urlString,
boolean preserveEmptyKeys = true,
boolean decodeValues = false
){
var emptyKeyValBool = arguments.preserveEmptyKeys;
var decodeURLValues = arguments.decodeValues;
var queryStr = reReplace(arguments.urlString,"^\?","");
var queryParamStruct = {};
<cfscript>
public struct function queryStringToStruct(
required string urlString,
boolean preserveEmptyKeys = true,
boolean decodeValues = false
){
var emptyKeyValBool = arguments.preserveEmptyKeys;
var decodeURLValues = arguments.decodeValues;
var queryStr = reReplace(arguments.urlString,"^\?","");
var queryParamStruct = {};
@spillsthrills
spillsthrills / getLocaleInfo
Last active November 7, 2019 19:18
Lucee getLocaleInfo script example
<cfscript>
//Eng
lang = getLocaleInfo().language;
writeoutput(lang);
writedump(getButtonText(lang));
//German
setLocale("German (Standard)");
lang = getLocaleInfo().language;
writeoutput(lang);
writedump(getButtonText(lang));