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 / app.component.ts
Created Dec 6, 2019
Using $any() To Temporarily Disable Type-Checking Within A Component Template In Angular 9.0.0-rc.4
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface Person {
id: string;
name: string;
}
@bennadel
bennadel / struct.cfm
Created Dec 4, 2019
The Elvis Operator Can Be Chained Multiple Times In A Single Expression In Lucee CFML 5.3.3.62
View struct.cfm
<cfscript>
apiResponse = {
errors: {
transaction: {
key: "info.number"
}
}
};
@bennadel
bennadel / capture-pointer-events.js
Created Dec 2, 2019
Capturing Pointer Events Using Bookmarklets
View capture-pointer-events.js
(function capturePointerEvents() {
var parentTag = ( document.head || document.body || document.documentElement );
var styleTag = document.createElement( "style" );
styleTag.setAttribute( "type", "text/css" );
styleTag.setAttribute( "data-caution", "Injected by bookmarklet" );
styleTag.innerHTML = `
html,
html * {
@bennadel
bennadel / list.cfm
Created Nov 27, 2019
Fixing Connection Failure: Unable To Determine MIME Type Errors With sslCertificateInstall() In Lucee CFML 5.3.3.62
View list.cfm
<cfscript>
// This is the local development environment that we'll be hitting via CFHTTP.
domain = "projects.local.invisionapp.com";
// Examine the collection of SSL Certificates installed on THIS server for the given
// target domain.
for ( cert in sslCertificateList( domain ) ) {
dump( cert );
@bennadel
bennadel / average-duration-by-feature-flag.nrql
Last active Nov 26, 2019
Tracking Feature Flags In New Relic And NRQL Using The Java Agent In Lucee CFML 5.3.3.62
View average-duration-by-feature-flag.nrql
SELECT
average( duration )
FROM
Transaction
WHERE
appName = 'local-cfprojects-bennadel'
AND
resourceUri = '/d/ben/default'
SINCE
10 minutes ago
@bennadel
bennadel / snippet-1.ts
Created Nov 25, 2019
TypeScript And .parentNode vs .parentElement In Angular 9.0.0-rc.3
View snippet-1.ts
@Component({
selector: "app-root",
styleUrls: [ "./app.component.less" ],
template:
`
<div class="foo">
<div class="bar">
<div class="baz">
<p>
<a (click)="handleClick( $event.target )">Find .bar</a>
@bennadel
bennadel / app.component.html
Created Nov 24, 2019
Customizing A Select Component Using TemplateRef And NgTemplateOutlet In Angular 9.0.0-rc.3
View app.component.html
<!--
Our HtmlSelect component allows the developer to customize the rendering of the
component using TemplateRef inputs. Some templates, like the [optionTemplate], are
REQUIRED. But, other templates, like the [rootTemplate] and the [nullTemplate], are
OPTIONAL. Since we're going to be instantiating multiple dropdown components, let's
define our templates up top and then re-use them for each dropdown instance below.
-->
<!-- This is the template for the MENU ROOT when NO OPTION is selected. -->
<ng-template #nullTemplateRef>
@bennadel
bennadel / app.component.ts
Created Nov 23, 2019
Creating A Custom Select Component With The Options-Menu In The Root Stacking Context In Angular 9.0.0-rc.3
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
@Component({
selector: "app-root",
styleUrls: [ "./app.component.less" ],
template:
@bennadel
bennadel / app.component.ts
Created Nov 22, 2019
Having Fun With Position: Fixed And Element.getBoundingClientRect() In Angular 9.0.0-rc.2
View app.component.ts
// Import the core angular services.
import { Component } from "@angular/core";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface Overlay {
left: number;
height: number;
top: number;
@bennadel
bennadel / test.cfm
Created Nov 21, 2019
Using MySQL's Null-Safe Equality Operator With CFQueryParam's Null Option In Lucee CFML 5.3.3.62
View test.cfm
<!--- Mock out some search values. --->
<cfset filterProjectID = 9 />
<cfset filterParentID = 0 />
<cfquery name="test" datasource="testing">
SELECT
f.*
FROM
asset_folder f
WHERE
You can’t perform that action at this time.