Skip to content

Instantly share code, notes, and snippets.

View skorfmann's full-sized avatar

Sebastian Korfmann skorfmann

View GitHub Profile
#!/usr/bin/env python3
"""
Git Metrics Analyzer - Derive commit statistics and developer activity metrics from git history
Similar to GitClear's research on developer commit patterns and annual days active
"""
import subprocess
import json
import argparse
from datetime import datetime, timedelta
@skorfmann
skorfmann / relay.ts
Created November 16, 2024 20:31
cloudflare durable object relaying bluesky's jetstream. had memory issues, switched to a dedicated container
import { DurableObject } from "cloudflare:workers";
/**
* Welcome to Cloudflare Workers! This is your first Durable Objects application.
*
* - Run `npm run dev` in your terminal to start a development server
* - Open a browser tab at http://localhost:8787/ to see your Durable Object in action
* - Run `npm run deploy` to publish your application
*
* Bind resources to your worker in `wrangler.toml`. After adding bindings, a type definition for the

Built this as one off script to post a bunch of records to bluesky based on a given csv to bootstrap https://bsky.app/profile/cdk.dev

sonnet 3.5 wrote all the code

/**
* Post-synthesis function to configure AWS provider for LocalStack
*/
exports.postSynth = function(config) {
const endpoint = "http://localhost:4566";
const services = [
"apigateway", "apigatewayv2", "cloudformation", "cloudwatch", "dynamodb", "ec2", "es",
"elasticache", "firehose", "iam", "kinesis", "lambda", "rds", "redshift", "route53",
"secretsmanager", "ses", "sns", "sqs", "ssm", "stepfunctions", "sts"

MoneyMoney CSV Export with Apple Script and Automator

  • adjust set accounts to {"IBAN 1", "IBAN 2"}
  • replace yourPassword with your MoneyMoney password
  • replace /your/local/path/ with your actual target path
  • set the time range set yesterday to (today - (1 * days))

Load this file in Automator and get fully automated exports.

import { Credentials } from "@aws-amplify/core";
import { AuthOptions, createAuthLink } from "aws-appsync-auth-link";
import { createSubscriptionHandshakeLink } from "aws-appsync-subscription-link";
import {
ApolloClient, ApolloLink, HttpLink, InMemoryCache
} from "@apollo/client/core"
import gql from 'graphql-tag';
global.WebSocket = require('ws');
@skorfmann
skorfmann / custom-data-source.ts
Last active July 8, 2021 13:54
A custom data source for cdktf without generics
import { Construct, Node, } from "constructs";
import { Resource, TerraformResource, TerraformAsset, AssetType } from 'cdktf';
import * as fs from "fs";
import * as path from 'path'
import { DataExternal } from "@cdktf/provider-external"
export interface CustomDataSourceConfig {
code(input: any): Promise<any>
inputs: any;
dependsOn?: TerraformResource[];
@skorfmann
skorfmann / README.md
Last active May 3, 2021 08:59
An example for a custom provider leveraging https://github.com/lukekaalim/terraform-plugin-node-SDK/ This
@skorfmann
skorfmann / custom-data-source.ts
Last active February 3, 2021 11:05
This uses the external Terraform provider (https://registry.terraform.io/providers/hashicorp/external) to build ad hoc data sources for cdktf.
import { Construct, } from "constructs";
import { Resource, TerraformResource } from 'cdktf';
import * as fs from "fs";
import * as path from 'path'
import { DataExternal } from "../.gen/providers/external"
export interface CustomDataSourceConfig<Inputs, Outputs> {
code(input: Inputs): Promise<Outputs>
inputs: Inputs;
dependsOn?: TerraformResource[];
import { Construct, Tag } from '@aws-cdk/core';
import { App, Stack } from '../../../packages/@terrastack/core';
import { AwsProvider, AwsS3Bucket, AwsIamPolicy } from '../.generated/aws';
import { PolicyDocument, PolicyStatement, AnyPrincipal, Effect } from "@aws-cdk/aws-iam"
const app = new App();
class MyBucketStack extends Stack {
constructor(scope: Construct, ns: string) {
super(scope, ns);