Skip to content

Instantly share code, notes, and snippets.

View CharlieDigital's full-sized avatar

Charles Chen CharlieDigital

View GitHub Profile
@CharlieDigital
CharlieDigital / Program.cs
Created September 7, 2025 01:30
C# Expression Paths
using System.Linq.Expressions;
List<string> MemberNames(Expression<Func<User, object>> u)
{
return ExpressionReader.GetNestedMemberNames(u);
}
Console.WriteLine(string.Join(".", MemberNames(u => u.UserProfile.HomeAddress.City)));
public class User
@CharlieDigital
CharlieDigital / delivery.ts
Last active April 2, 2022 23:59
Code listing showing object-oriented techniques for using structural logic
class Product {
constructor(
public readonly name: string,
public readonly weight: number,
public readonly isLiquid: boolean = false
) { }
}
type ShippingMethod = 'USPS' | 'UPS' | 'FedEx' | 'DHL'
@CharlieDigital
CharlieDigital / CustomResources.json
Created February 17, 2021 03:06
CloudFormation JSON template which demonstrates how to create an HTTP data source for AWS Secrets Manager
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Test stack",
"Metadata": {},
"Parameters": {
"AppSyncApiId": {
"Type": "String",
"Description": "The id of the AppSync API associated with this project."
}
},