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 / 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
{
"categories": [
"Employee Recognition",
"Christmas",
"Birthday",
"Thank you",
"Father's Day",
"Just Because",
"Thanksgiving",
"Encouragement",
@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 / bookmarklet.js
Last active December 16, 2021 20:48
Surprise Uber Delivery Day Bookmarklet - Random Delivery Date Selector
javascript: (function () { document.querySelector("label[for=schedule-option]").click(); var dateSelect = document.querySelector("div[role=dialog] select"); var opts = dateSelect.getElementsByTagName('option'); var i = Math.floor(Math.random() * opts.length); dateSelect.selected = i; dateSelect.style.display = 'none'; dateSelect.closest('div').innerHTML = "Random day selected! Prepare to be surprised! 😁"; })()
@timsayshey
timsayshey / Application.cfc
Created November 11, 2021 15:14 — forked from roryl/Application.cfc
Lucee Database Client Storage
component {
this.datasources["lucee_sessions"] = {
class: 'org.gjt.mm.mysql.Driver'
, connectionString: 'jdbc:mysql://192.168.33.10:3306/lucee_sessions?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true'
, username: 'lucee_sessions'
, password: "encrypted:8c3ea865feab8133a7614f58aee150cddee0ed6f82a476f1"
// optional settings
, storage:true // default: false
@timsayshey
timsayshey / FormFields.vue
Last active March 19, 2021 15:40
form.vue
<template lang="pug">
.mb-2.mt-5(:data-type='type')
div(v-if='type === "html"', v-html='html')
div(v-else-if='type === "checkbox"')
label {{ label }}
input(
type='checkbox',
:checked='inputValue',
@input='updateCheckbox($event.target.checked)'
)
@timsayshey
timsayshey / index.cfm
Created February 14, 2021 21:06 — forked from bennadel/index.cfm
Scaling An Image During A Draw Operation Using GraphicsMagick And Lucee CFML 5.2.9.31
<cfscript>
param name="url.image" type="string" default="beach-small.jpg";
startedAt = getTickCount();
// CAUTION: For the sake of the demo, I am not validating the input image. However,
// in a production setting, I would never allow an arbitrary filepath to be provided
// by the user! Not without some sort of validation.
inputFilename = url.image;
@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
@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 / 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(" ");