Skip to content

Instantly share code, notes, and snippets.

@adamhjk
adamhjk / summary.md
Last active June 16, 2026 16:45
Summary of a work item through a software factory

Work Item: light-tracking-fixes

Factory: mvtt-factory · Definition: v1

Started: 2026-06-16 15:21:37 UTC

Currently: active at code-review (cycle 1)

Path: intake → planning → plan-review → planning → plan-review → planning → plan-review → planning → plan-review → implementing → checks → code-review

task :classify_nodes do
@dns_names.each do |description|
description =~ /^(.+?)\..+$/
hostname = $1
node = @ic.get_node(hostname)
if exists?(:puppet_env)
EC2_DATA[:iclassify_attribs][:puppet_env] = puppet_env
end
node.tags = EC2_DATA[:iclassify_tags]
EC2_DATA[:iclassify_attribs].each do |name, values|
@adamhjk
adamhjk / integration.rs
Created December 5, 2019 19:47
tonic integration tests
use lazy_static::lazy_static;
use tokio;
use tracing::{self, debug};
use tracing_subscriber::{self, EnvFilter, FmtSubscriber};
use ureq;
use std::env;
use si_account::{protobuf, protobuf::server::Account, service::Service};
use si_data::Db;
@adamhjk
adamhjk / service.rs
Created May 28, 2020 14:34
tonic with tracing, opentelemetry, and context propagation
use opentelemetry::api::propagation::text_propagator::HttpTextFormat;
use tracing::{debug, info};
use tracing_futures::Instrument as _;
use tracing_opentelemetry::OpenTelemetrySpanExt as _;
#[tonic::async_trait]
impl crate::protobuf::kubernetes_server::Kubernetes for Service {
async fn kubernetes_deployment_component_get(
&self,
mut request: tonic::Request<crate::protobuf::KubernetesDeploymentComponentGetRequest>,
@adamhjk
adamhjk / BUCK
Last active April 27, 2023 23:27
Brutalist buck2 + cargo rule
load("//build-rules/cargo.bzl", "cargo_library")
cargo_library(
name = "dal",
package = "dal",
build_type = "debug",
srcs = glob(["lib/dal/**/*.rs", "lib/dal/build.rs"]),
out = "libdal"
)
@adamhjk
adamhjk / README.md
Last active July 25, 2021 05:44
Prove that Chef Solo works just fine with default attributes. Output of chef-solo -c solo.rb -j test.json:

Proves that default attributes work fine in Chef Solo:

chef-solo -c solo.rb -j test.json

  /t/w/solo-def ❯❯❯ chef-solo -c solo.rb -j test.json
  Starting Chef Client, version 11.4.4
  Compiling Cookbooks...
  [2013-08-02T10:30:01-07:00] WARN: I see that solo works... fine
 Converging 1 resources
@adamhjk
adamhjk / trace_prop.ts
Last active May 20, 2020 19:17
Opentelemetry manual trace propagation
import { WebTracerProvider } from "@opentelemetry/web";
import { ZoneContextManager } from "@opentelemetry/context-zone";
import { CollectorExporter } from "@opentelemetry/exporter-collector";
import * as api from "@opentelemetry/api";
const provider = new WebTracerProvider({
//plugins: [new DocumentLoad() as any, new UserInteractionPlugin()],
plugins: [new DocumentLoad() as any],
});
provider.addSpanProcessor(
@adamhjk
adamhjk / simpleTypescript.ts
Created April 22, 2020 14:30
A simple example of typescript being helpful
interface AssociationConstructor {
typeName: Association["typeName"];
methodName: Association["methodName"];
fieldName?: Association["fieldName"];
}
interface BelongsToConstructor
extends Omit<AssociationConstructor, "methodName"> {
fromFieldPath: BelongsTo["fromFieldPath"];
methodName?: Association["methodName"];
@adamhjk
adamhjk / proto-annotate.toml
Last active January 15, 2020 04:50
What I mean about graphql
protoPackageName = "si.account"
service.Account.CreateAccount.skipauth = true
service.Account.CreateAccount.mutation = true
service.Account.GetBillingAccount.query = true
service.Account.CreateUser.mutation = true
service.Account.GetUser.query = true
service.Account.ListUsers.query = true
service.Account.ListWorkspaces.query = true
service.Account.ListOrganizations.query = true
@adamhjk
adamhjk / custom.erb
Created June 4, 2012 05:00
Apache virtualhost file
<% if @port != 80 -%>
Listen <%= @port %>
<% end -%>
<VirtualHost *:<%= @port %>>
ServerAdmin webmaster@localhost
DocumentRoot <%= @document_root %>
<Directory />
Options FollowSymLinks