Skip to content

Instantly share code, notes, and snippets.

View andyscott's full-sized avatar
🌲

Andy Scott andyscott

🌲
View GitHub Profile
{ pkgs }:
with pkgs;
let
# copied directly from an old version of nixpkgs:
# https://github.com/NixOS/nixpkgs/blob/e8e39a55a0e0a4cbf6a76dfe914efa559f92aeaa/
# pkgs/development/tools/continuous-integration/fly/default.nix
original = buildGoModule rec {
pname = "fly";
version = "7.8.3";
@andyscott
andyscott / k-for-each.py
Created November 28, 2022 20:09
run a command on each pod given a selection criteria
#!/usr/bin/env nix-shell
#!nix-shell -i python3
import argparse
import sys
import typing as t
import subprocess
load(
":common.bzl",
"FilesInfo",
)
def _strip_prefix(value, prefix):
if value.startswith(prefix):
return value[len(prefix):]
else:
return value
@andyscott
andyscott / .gitconfig
Created January 14, 2020 18:09
git tardis
[alias]
tardis = "!f() { \
git --no-pager log --color -g --abbrev-commit --pretty='%C(auto)%h% D %C(blue)%cr%C(reset) %gs (%s)' \
| fzf --ansi \
| cut -d \" \" -f 1 \
| xargs -I {} bash -c \"( git name-rev --no-undefined --name-only {} 2>/dev/null || echo {} )\" \
| xargs git checkout; \
}; f"
#!/usr/bin/env bash
function show_usage {
cat <<'EOF'
Converts Bazel's build event protocol to JUnit XML
usage: bep-json-to-junit-xml <output-dir> [<input-bep-json>]
options:
output-dir : The directory to write junit xmls.
import cats._
import cats.implicits._
type Coalgebra[F[_], A] = A => F[A]
type Algebra[F[_], A] = F[A] => A
type ListF[A, B] = Option[(A, B)]
implicit def functorListF[A]: Functor[ListF[A, ?]] =
Functor[Option].compose[(A, ?)]
#
# .bazelrc has --test_tag_filters=-integration
# so integration tagged tests are skipped by default
#
echo ">> 🧐 Running Isolated Tests 🧐 <<"
START_TIME=$SECONDS
./bazel test \
//...
ELAPSED_TIME_MS_TEST=$(((SECONDS - START_TIME)*1000))
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
my $bfg_jar_url = "https://repo1.maven.org/maven2/com/madgag/bfg/1.13.0/bfg-1.13.0.jar";
sub trim {
package main
import (
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation -framework CoreLocation
#import <CoreLocation/CoreLocation.h>
@interface WhereAmI : NSObject <CLLocationManagerDelegate>

Keybase proof

I hereby claim:

  • I am andyscott on github.
  • I am andyscott (https://keybase.io/andyscott) on keybase.
  • I have a public key whose fingerprint is 09AB 2DD7 D126 ACB2 1FBF B1FC 8C70 7300 EEBD 205A

To claim this, I am signing this object: