This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! 😁"; })() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"regexp" | |
"strconv" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfcomponent> | |
<cffunction name="upload" access="remote" returntype="struct" returnformat="json" output="false"> | |
<cfscript> | |
var uploadDir = expandPath('.') & '/uploads/'; // should be a temp directory that you clear periodically to flush orphaned files | |
var uploadFile = uploadDir & arguments.NAME; | |
var response = {'result' = arguments.NAME, 'id' = 0}; | |
var result = {}; | |
// if chunked append chunk number to filename for reassembly | |
if (structKeyExists(arguments, 'CHUNKS')){ |