Skip to content

Instantly share code, notes, and snippets.

@benfoster
benfoster / integration-guide.md
Created February 25, 2026 08:00
Credyt Integration Guide

Credyt integration guide for AI assistants and tools

This guide helps AI assistants (like ChatGPT, Claude, Lovable, and other AI and vibe coding tools) walk developers through integrating Credyt into their applications.

Credyt is real-time billing infrastructure built for AI products. It handles usage-based billing, prepaid wallets, and revenue recognition, so you don't have to build it yourself.

⚠� CRITICAL: READ THIS FIRST ⚠�​

STOP. Do not write any code yet.

Keybase proof

I hereby claim:

  • I am benfoster on github.
  • I am benfoster (https://keybase.io/benfoster) on keybase.
  • I have a public key ASAHVC9RNoa9g8n5MtUGFrXPGegaMX-gzzUSdmnbeKJSwgo

To claim this, I am signing this object:

public static void Execute(ChargeCommand command)
{
var pipeline = new PipelineBuilder<ChargeContext>()
.Register(new TimingHandler())
.Register(new LoggingHandler())
.Register(new ValidationHandler(
validationPipeline =>
{
validationPipeline.Register(new AmountValidator(maxAmount: 500));
}
@benfoster
benfoster / loggingshutdowndetector.cs
Created August 8, 2016 09:52
Serilog Application Shutdown
using Serilog;
using Serilog.Core;
using System;
using System.Web.Hosting;
namespace Merchant.Api.Logging
{
/// <summary>
/// Detects application pool shutdowns and ensures all batched log entries
/// are flushed.
@benfoster
benfoster / pipeline.cs
Created June 23, 2016 07:24
c# Pipeline
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace PipelineDemo
{
// http://www.rantdriven.com/post/2009/09/16/Simple-Pipe-and-Filters-Implementation-in-C-with-Fluent-Interface-Behavior.aspx
public interface IFilter<TContext>
{
@benfoster
benfoster / Global.asax.cs
Created February 10, 2016 10:33
Theme-able View Engine in ASP.NET MVC 4/5
private void InitializeViewEngine()
{
HostingEnvironment.RegisterVirtualPathProvider(new DynamicAssetVirtualPathProvider());
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new ThemableViewEngine
{
Theme = ctx => DependencyResolver.Current.GetService<ISiteContext>().Theme.ThemeName
});
@benfoster
benfoster / script.js
Created January 19, 2016 11:41
Disable lightbox on Calico spotlight layout
<script>
$('.fab-portfolio-details .project-media li a')
.css('cursor', 'default')
.on('click', function() {
return false;
});
var dtl = $('.fab-portfolio-details .project-media');
if (dtl.length) {
$.magnificPopup.defaults.disableOn = function() { return false; }
@benfoster
benfoster / MessageHandlerConfig.cs
Created May 27, 2015 11:26
SqlAzureEntityTagStore
private void ConfigureCaching()
{
var services = ConfigurationManager.ConnectionStrings[Constants.FabrikServicesConnectionStringKey];
var cacheControlPolicy = new AttributeBasedCacheControlPolicy(new CacheControlHeaderValue
{
Private = true,
MustRevalidate = true,
NoTransform = true,
MaxAge = TimeSpan.Zero
var gulp = require('gulp'),
$ = require('gulp-load-plugins')({
pattern: [
'gulp-*',
'gulp.*',
'del',
'run-sequence',
'main-bower-files'
]
});
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace ReflectionDemo
{
class Program