Skip to content

Instantly share code, notes, and snippets.

View cdvillard's full-sized avatar
🏠
Working from home

Charles Villard cdvillard

🏠
Working from home
View GitHub Profile
@cdvillard
cdvillard / index.js
Created October 25, 2025 20:04
component-gist
This file has been truncated, but you can view the full file.
/* @greenlake-widgets/global-search (2.214.0) | built-on: 2025-10-24T23:42:20.406Z */
var sO = Object.defineProperty;
var dx = (e) => {
throw TypeError(e);
};
var lO = (e, t, r) => t in e ? sO(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
var lg = (e, t, r) => lO(e, typeof t != "symbol" ? t + "" : t, r), H0 = (e, t, r) => t.has(e) || dx("Cannot " + r);
var _e = (e, t, r) => (H0(e, t, "read from private field"), r ? r.call(e) : t.get(e)), en = (e, t, r) => t.has(e) ? dx("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), _r = (e, t, r, o) => (H0(e, t, "write to private field"), o ? o.call(e, r) : t.set(e, r), r), Cn = (e, t, r) => (H0(e, t, "access private method"), r);
var av = (e, t, r, o) => ({
set _(u) {
@cdvillard
cdvillard / flags.config.ts
Created September 27, 2025 22:16
`vite-plugin-flags`: a Vite plugin and supporting scripts for enabling Vercel's Flags Explorer in local development for frontend-only projects
/*
* ./vercel/flags.config.ts
* Feature flags configuration for local development and Vercel middleware.
* Add/edit flags and attributes here in FLAG_DEFS to expose them via
* `/.well-known/vercel/flags` and to allow URL → cookie overrides in middleware.ts.
*/
export type FlagValue = string | number | boolean | null;
export type FlagDef = {
@cdvillard
cdvillard / idle.ts
Created December 21, 2024 22:49
"Idling" a TypeScript function
/**
* `idle` sets a timeout within a Promise that can be called within
* asynchronous contexts. This allows for the delay of an async callback.
* @param seconds
* @returns Promise<void>
*
* const asyncFunction = async (message: string) => {
* console.log("This was written now");
* await idle(10);
* console.log(message);
<!--begin text ad markup-->
<table class='letterhead-promotion' style='margin: 0 auto; max-width: 600px;'>
<tr class='letterhead-promotion__row'>
<td class='letterhead-promotion__row__cell' style='text-align: center; padding-bottom: 8px;'>
<p class='letterhead-promotion__row__cell__promoter-display-name' style='font-size: 85%;'>
Advertisement from {{ promoterDisplayName }}
</p>
</td>
</tr>
<tr class='letterhead-promotion__row'>
@cdvillard
cdvillard / Bio.txt
Last active July 22, 2019 01:38
Draft bio
Charles Villard is a web developer with a passion for front-end JavaScript development, static site generators, and keeping the web accessible and available to all. A former journalism student, Charles started teaching himself to code in 2014. Since then, he has worked on projects scaling from small local businesses to large enterprise. During his downtime, Charles is likely cooking, raising his two daughters, or reading up on development trends that pique his interests. The latest topics have included design systems, severless architecture, and progressive web applications.

Keybase proof

I hereby claim:

  • I am cdvillard on github.
  • I am cdvillard (https://keybase.io/cdvillard) on keybase.
  • I have a public key ASCqdztm7O73QXFlESo7t47iRkhDU5EpLGHxE47gU7InCwo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@cdvillard
cdvillard / simpleCustomActionFilter.cs
Created February 28, 2016 14:10
Simple Custom Action Filter
public class SimpleActionFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
Debug.WriteLIne("This Event Fired: OnActionExecuting");
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
Debug.WriteLine("This Event Fired: OnActionExecuted");
}
@cdvillard
cdvillard / sampleActionFilter.cs
Created February 28, 2016 13:54
Sample Action Filter
public class SampleActionFilter : ActionFilterAttribute
{
public override void OnActionExecuting (ActionExecutingContext filterContext)
{
Debug.WriteLine("This Event Fired: OnActionExecuting");
}
public override void OnActionExecuted (ActionExecutedContext filterContext)
{
Debug.WriteLine("This Event Fired: OnActionExecuted");