Skip to content

Instantly share code, notes, and snippets.

View timsayshey's full-sized avatar
🚀
Coding all the things

Tim Badolato timsayshey

🚀
Coding all the things
View GitHub Profile
@timsayshey
timsayshey / itemBean.cfc
Created June 19, 2012 15:54
Coldbox itemBean & itemGateway
<cfcomponent output="false" cache="true">
<cfscript>
_datasource = 0;
_itemGW = 0;
item.id = 0;
item.code = "";
item.name = "";
item.BookXML = "";
item.description = "";
@timsayshey
timsayshey / Shop.cfc
Created July 27, 2012 14:50
Model or Conroller or Service or ???
<cfscript> //Needed for code coloring
/**
* @hint This is the Shop controller which handles the shopping cart
*/
component extends="Controller" {
/**
* @hint Runs before functions
*/
public function init()
@timsayshey
timsayshey / CFWheels Model Logger
Last active February 17, 2023 23:25
CFWheels Model Logger
This will let you log every time a user inserts or updates a record.
So you can later say:
Tim performed insert to the "25" record in the Page table via Pages' Edit a few hours ago, etc
Create a table called Logs with the following columns:
id int primary autoinc
userid int
modelid varchar
savetype varchar
@timsayshey
timsayshey / index.cfm
Last active August 29, 2015 14:08
Get Categorized Items for Each Vendor and Display in Bootstrap
<cfoutput>
<cfset qItems = model("User").findAll(
where = "vendorid IS NOT NULL",
order = "vendorid DESC, itemcategoryid ASC, sortorder ASC",
include = "item(itemcategoryjoin(itemcategory)),UsergroupJoin(usergroup)"
)>
<h3><strong>Vendors</strong></h3>
<br />
@timsayshey
timsayshey / gist:72f0eef154bf7ac972b1
Last active August 29, 2015 14:12
CFWheels Plugin: Bypass Cache for Logged in Users
<cfcomponent>
<cffunction name="init">
<cfset this.version = "1.0,1.0.1,1.0.2,1.0.3,1.0.4,1.0.5,1.0.6,1.1,1.1.1,1.1.2,1.1.3,1.1.4,1.1.5,1.1.6,1.1.7,1.1.8,1.3.0,1.3.1,1.3.2">
<cfreturn this>
</cffunction>
<!---
Just added isNull(session.user) to 2 conditions so cache doesn't run for logged in users -- Per is working on fixing this for 1.3.3 or 2.0
https://github.com/cfwheels/cfwheels/issues/439
--->
.project
@timsayshey
timsayshey / lambda-twilio-slack-funtimes.js
Last active February 3, 2017 22:56
Slack slash command to Lambda Twilio SMS Message
// Credit: Charlie & Tim
// Go to AWS API Gateway
// Add Resource, then add a GET method with a node js lambda function (paste the code from below in)
// Add an integration template to the API Gateway resource to allow the 'text' url param from Slack
var https = require( "https" );
var querystring = require( "querystring" );
exports.handler = function( event, context, callback ) {
var data = event.text.split(" ");
@timsayshey
timsayshey / wp-shortcodes.go
Last active June 8, 2022 03:31
Wordpress Shortcodes in Golang
package main
import (
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strconv"
"strings"
)
@timsayshey
timsayshey / keybase.md
Created August 21, 2019 18:26
keybase.md

Keybase proof

I hereby claim:

  • I am timsayshey on github.
  • I am timsayshey (https://keybase.io/timsayshey) on keybase.
  • I have a public key ASCHHiFiRvULF_WvGY8N6RXiWqDNdEi8hNVV4vROYk1tIAo

To claim this, I am signing this object:

@timsayshey
timsayshey / gist:b0e11850b10f01b3cfa4b75dda4f4e98
Last active June 29, 2020 15:34
Bash Zsh Bible Verse on Open
# Requires bash tool jq for json parsing - brew install jq
# Random Bible Verse
# https://beta.ourmanna.com/api/v1/get?format=json&order=random
# https://beta.ourmanna.com/api/v1/get?format=json
curl --max-time 2 -s https://beta.ourmanna.com/api/v1/get\?format\=json\&order\=random \
| jq --raw-output '"👉 ",.verse.details.text," - ",.verse.details.reference," 💯 "' | tr -d '\n'
echo
echo