Skip to content

Instantly share code, notes, and snippets.

Ben Nadel bennadel

Block or report user

Report or block bennadel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bennadel
bennadel / Scanner.cfc
Created Oct 14, 2019
Building A Simple Redis Key Scanner Using Lucee CFML 5.2.8.50 And Jedis
View Scanner.cfc
component
output = false
hint = "I provide a simple API for iterating and viewing keys in a given Redis database."
{
/**
* I initialize the Scanner with the given JavaLoader.
*
* @javaLoaderForJedis I am the JavaLoader for the Jedis library.
*/
@bennadel
bennadel / snippet1.sql
Created Oct 11, 2019
Thought Experiment: Splitting A Single Data Table Up Into High-Writes And High-Reads For Better Performance In MySQL
View snippet1.sql
UPDATE
user u
SET
u.lastRequestAt = UTC_TIMESTAMP()
WHERE
u.id = ?
;
SELECT
u.id,
@bennadel
bennadel / Application.cfc
Created Oct 10, 2019
Playing With Lists And Blocking Pop Operations In Redis And Lucee 5.2.9.40
View Application.cfc
component
output = false
hint = "I define the application settings and event handlers."
{
// Configure the application runtime.
this.name = "RedisListWithJsonExploration";
this.applicationTimeout = createTimeSpan( 0, 1, 0, 0 );
this.sessionManagement = false;
@bennadel
bennadel / test.cfm
Created Oct 8, 2019
CFQueryParam "Fails Silently" With Empty Lists And IN Clauses In Lucee 5.2.9.40
View test.cfm
<cfscript>
results = queryExecute(
sql = "
SELECT
p.id,
p.name
FROM
project p
WHERE
@bennadel
bennadel / app.component.ts
Created Sep 27, 2019
Experiment: Using A Feature Flag To Conditionally Render Routable Components In Angular 9.0.0-next.8
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// Import the application components and services.
import { UserConfigService } from "./user-config.service";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
@Component({
@bennadel
bennadel / Application.cfc
Created Sep 25, 2019
Tracking Page Request Metrics With Framework One (FW/1) And Lucee CFML
View Application.cfc
public void function before( required struct rc ) {
rc.requestInitiatedAt = getTickCount();
rc.actionToTrack = getActionToTrack();
if ( rc.actionToTrack.len() ) {
getBeanFactory()
.getBean( "RequestMetricsService" )
.recordRequestStart( rc.actionToTrack )
@bennadel
bennadel / index.htm
Created Sep 18, 2019
Using CSS Overscroll-Behavior To Prevent Scrolling Of Parent Containers From Within Overflow Containers
View index.htm
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>
Using CSS Overscroll-Behavior To Prevent Scrolling Of Parent Containers From Within Overflow Containers
</title>
<style type="text/css">
@bennadel
bennadel / test.cfm
Created Sep 14, 2019
Using An Immediately Invoked Function Expression (IIFE) And CachedWithin To Easily Cache Steps In A Procedural Script In Lucee 5.3.2.77
View test.cfm
<cfscript>
someData = "Hello World!";
// Imagine that this step of the "procedure script" is a bit more intensive to
// calculate. As such, we can easily cache this step without too much ceremony by
// wrapping it in an Immediately Invoked Function Expression (IIFE) that makes use
// of the cachedWithin function memoization feature.
transformedData = (function() cachedWithin = createTimeSpan( 0, 1, 0, 0 ) {
@bennadel
bennadel / app.component.html
Created Sep 10, 2019
Discriminated Unions Don't Seem To Work In Angular 9.0.0-next.5 When fullTemplateTypeCheck Is Enabled
View app.component.html
<div *ngFor="let value of values">
<p [ngSwitch]="value.type">
<span *ngSwitchCase="( 'foo' )">
{{ value.foo }}
</span>
<span *ngSwitchCase="( 'bar' )">
{{ value.bar }}
</span>
<span *ngSwitchCase="( 'baz' )">
@bennadel
bennadel / app.component.ts
Created Sep 9, 2019
Creating An Incrementing Input Directive Inspired By Chrome Dev Tools In Angular 9.0.0-next.5
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
@Component({
selector: "app-root",
styleUrls: [ "./app.component.less" ],
template:
You can’t perform that action at this time.