Skip to content

Instantly share code, notes, and snippets.

View adrian-gierakowski's full-sized avatar

Adrian adrian-gierakowski

View GitHub Profile
import {
Span as SentrySpan,
SpanStatusType,
getActiveSpan,
getActiveTransaction,
getCurrentHub,
startSpanManual,
startTransaction,
} from "@sentry/core"
import type * as Sentry from "@sentry/types"
@SeaJaredCode
SeaJaredCode / README.md
Last active December 2, 2023 07:25
Command line support for getting tokens from Google IAP, with ArgoCD example for working with token.

Overview

The file iap_credentials_helper.sh is broadly applicable to fetch tokens for use by CLI tools that can't navigate Google's IAP via the API.

ArgoCD Wrapper Use

This wrapper is intended to be a very lightweight addition to the standard argocd command. Specifically, removing the need to type `-- header: Bearer ${IAP_TOKEN}" (or similar) onto every command!

{ pkgs, lib, config, ... }: with lib.types;
let
postgresqlInstanceType = submodule {
options.connectionString = lib.mkOption {
type = str;
};
};
@borispoehland
borispoehland / effects.ts
Last active March 3, 2024 08:48
3 fetch effects for effect-ts. One uses cache: no-store, one cache: force-cache and one uses the default cache / revalidate
import * as S from '@effect/schema/Schema'
import { Context, Effect } from 'effect'
export interface IFetcher {
fetch: typeof fetch
}
export const TFetcher = Context.Tag<IFetcher>('IFetcher')
class FreshFetcher implements IFetcher {
@geoffjay
geoffjay / starship.toml
Last active March 19, 2024 03:57
Starship prompt with nord colors
"$schema" = "https://starship.rs/config-schema.json"
# colorscheme
#
# #2E3440
# #3B4252
# #434C5E
# #4C566A
# #D8DEE9
# #E5E9F0
@roberth
roberth / minimod.nix
Last active December 29, 2023 07:47
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:

nix-bitcoin Setup

0. Concepts

Motivations

Terminology

  • nix - a language
  • nix - a packaging system
import * as T from "@effect-ts/core/Effect"
import * as S from "@effect-ts/core/Effect/Experimental/Stream"
import * as L from "@effect-ts/core/Effect/Layer"
import * as M from "@effect-ts/core/Effect/Managed"
import * as Q from "@effect-ts/core/Effect/Queue"
import * as SC from "@effect-ts/core/Effect/Schedule"
import { literal, pipe } from "@effect-ts/core/Function"
import { tag } from "@effect-ts/core/Has"
import * as O from "@effect-ts/core/Option"
import type { _A } from "@effect-ts/core/Utils"
@sts10
sts10 / rust-command-line-utilities.markdown
Last active March 28, 2024 08:47
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
#!/bin/bash
set -euo pipefail
# uncomment to debug
# set -x
echo "1️⃣. Does catalina know to create the nix directory?"
if ! grep nix /etc/synthetic.conf > /dev/null 2>&1; then
echo "nix missing from /etc/synthetic.conf. Adding it (will request sudo)"
echo "nix" | sudo tee -a /etc/synthetic.conf > /dev/null