Skip to content

Instantly share code, notes, and snippets.

View dmattia's full-sized avatar

David Mattia dmattia

  • Transcend.io
  • United States
View GitHub Profile
@dmattia
dmattia / sombra_with_llm_kubernetes_deployment.tf
Last active March 11, 2025 20:05
Sombra Helm Deployment with LLM
provider "aws" {
region = "eu-west-1"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.1.2"
name = "sombra-vpc"
cidr = "10.0.0.0/16"
@dmattia
dmattia / sombra_basic_kubernetes_deployment.tf
Last active February 14, 2025 05:17
Sombra Helm Deployment No LLM
provider "aws" {
region = "eu-west-1"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.1.2"
name = "sombra-vpc"
cidr = "10.0.0.0/16"
@dmattia
dmattia / mostPerfectPassingGames.ts
Created November 7, 2021 18:58
Qbs with the most 100% completion percentage games in a season
import got from 'got';
import { mapSeries } from 'bluebird';
/**
* Finds all players who had 100% completion percentages during a given week of a given year.
*
* @param year - The year the games were played
* @param week - The week of the regular season a game was played
* @returns a list of names
*/
#!/bin/bash
WORKSPACE="${WORKSPACE:-@main/main}"
echo "Finding dependencies to watch under $WORKSPACE..."
watchedDependencies=$(yarn info "$WORKSPACE" --all --recursive --dependents --json | jq ".children.Dependencies[].locator, .value" | grep '@workspace' | sed 's/.*@workspace://' | sed 's/"$//' | xargs echo)
echo "Dependencies being watched: $watchedDependencies"
echo ""
echo "Finding dependencies that changed..."
// external
import * as aws from '@pulumi/aws';
import * as pulumi from '@pulumi/pulumi';
const awsAccountId = aws.getCallerIdentity().then(({ accountId }) => accountId);
const accountArn = pulumi.interpolate`arn:aws:iam::${awsAccountId}:root`;
const kmsPolicy = accountArn.apply(
(arn) =>
({
Version: '2012-10-17',
@dmattia
dmattia / pettutor.ts
Last active September 23, 2021 19:40
PetTutor Feed dispense
// external
import noble from '@abandonware/noble';
noble.on('stateChange', async (state) => {
if (state === 'poweredOn') {
await noble.startScanningAsync();
}
});
noble.on('scanStart', () => {
@dmattia
dmattia / trading_bot.py
Last active October 25, 2021 04:30
Trading bot
print("Buy Bitcoin")
@dmattia
dmattia / terragrunt_light.js
Last active January 3, 2025 19:12
A less verbose terragrunt
/**
* Wrapper around terragrunt to display output succinctly on Atlantis.
*
* Terragrunt is notoriously verbose, which can cause Atlantis to output
* hundreds of comments on single PRs, which can be annoying.
*
* This script will output just the final plan for resources to update on
* successful terragrunt runs, but will output all terragrunt output on
* errors.
*/
"""
Prereq: pip install --user pandas xlrd
Usage:
1) Create accounts.xlsx file
2) Run 'python accounts.py'
"""
import pandas as pd
import json
import { mount } from "@vue/test-utils";
const parentComponent = {
provide() {
return {
val: 'from parent'
};
},
template: `
<div>