Skip to content

Instantly share code, notes, and snippets.

View evagoras's full-sized avatar

Evagoras Charalambous evagoras

View GitHub Profile
@evagoras
evagoras / .env
Last active September 28, 2023 16:20
Run a CommandBox ColdFusion instance as a Windows Service
APPNAME=grandfathering
ENVIRONMENT=test
COMMANDBOX_LOCATION=C\:\\commandbox
ROOT_FOLDER=C:\\dev\\cf\\mywebsite
@evagoras
evagoras / Coldbox.cfc
Last active September 28, 2023 16:20
Intercepting the QB module query executor in a ColdBox application
component {
// Configure ColdBox Application
function configure(){
//Register interceptors as an array, we need order
interceptors = [
// Enable when meeded to intercept QB calls
{
class = "interceptors.qbInterceptor",
@evagoras
evagoras / cardDao.cfc
Last active September 28, 2023 16:19
Overriding the inferred QB Module SQL types
component alias="daos.card" singleton {
property name="query" inject="provider:QueryBuilder@qb";
function update( required numeric id, required struct dto ) {
return query.from( "my_table" )
.where( "my_primary_id", id )
.update( dto );
}
@evagoras
evagoras / AppDynamicsManager.cfc
Last active September 28, 2023 16:18
Adding custom user metrics to AppDynamics in ColdFusion using Java
component displayname="AppDynamics Custom Data Logger" {
variables.agentDelegate = "";
variables.dataScope = "";
variables.appDynamicsReporter ="";
variables.allScopes = "";
public AppDynamicsManager function init() {
setAppDynamicsReporter();
return this;
@evagoras
evagoras / NewRelicManager.cfc
Last active September 28, 2023 16:17
Adding custom user metrics to NewRelic using their Java Agent API
component displayname="NewRelic Custom Data Logger" {
variables.newRelicAgent = "";
public NewRelicManager function init() {
setNewRelicAgent();
return this;
}
private void function setNewRelicAgent() {
@evagoras
evagoras / box.json
Last active September 28, 2023 16:16
A ForgeBox ColdBox module for the Lucee server 5.3.3 scheduled tasks
{
"name": "Lucee Administrator Scheduled Tasks Bootstrap UI",
"version": "1.0.0",
"slug": "lucee-scheduled-tasks",
"type": "modules",
"author": "Evagoras Charalambous",
"homepage": "https://github.com/evagoras/lucee-scheduled-tasks",
"shortDescription": "A Bootstrap 4 UI frontend for the Lucee Administrator Server Scheduled Tasks",
"projectURL": "https://github.com/evagoras/lucee-scheduled-tasks",
"location": "evagoras/lucee-scheduled-tasks",
@evagoras
evagoras / convert-file
Last active September 28, 2023 16:15
A ForgeBox CommandBox module for creating OSGi bundled JARs
# First install the CommandBox module
box install commandbox-osgi
# `cd` into the folder of the JAR that I need to convert
cd C:\dev\sites\abc\lib
# run the command
osgi convert file path=gson-2.8.5.jar bundleName=com.mycompany.myproject bundleVersion=1.0.0
# use my newly created bundle in CFML
@evagoras
evagoras / lighttpd-addition
Last active September 28, 2023 16:22
WordPress friendly URLs/404s with Lighttpd and things that can go wrong
$HTTP["host"] =~ "(^|\.)mysite\.com$" {
server.document-root = "/var/www/mysite.com/httpdocs"
server.errorlog = "/var/www/mysite.com/error.log"
accesslog.filename = "/var/www/mysite.com/access.log"
server.error-handler-404 = "/index.php?error=404"
var.wpdir = "/"
url.rewrite-once = (
@evagoras
evagoras / form-search
Last active September 28, 2023 16:22
How to handle and customize an empty search query in WordPress
@evagoras
evagoras / latest-10
Created September 28, 2023 07:32
Directly querying the WordPress database for posts
SELECT *
FROM view_all_posts
LIMIT 0, 10