Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@binaryfunt
binaryfunt / jupyter_notebook_config.py
Last active April 29, 2022 11:15
Jupyter notebooks - clear output pre-save hook (for cleaner git diffs)
# This file has to be saved in your Jupyter config directory (found by running
# jupyter --config-dir
# but usually C:\Users\<username>\.jupyter\jupyter_notebook_config.py on Windows
def scrub_output_pre_save(model, **kwargs):
"""scrub output before saving notebooks"""
# only run on notebooks
if model['type'] != 'notebook':
return
# only run on nbformat v4
@JJediny
JJediny / Jenkinsfile
Created February 22, 2017 20:17 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',
@inversion
inversion / terraform_resource_move.sh
Last active August 31, 2022 20:08
Update state after moving existing terraform resources to a module
#!/bin/bash
# 1. Fill in your module name
# 2. Run the terraform state mv commands from the output
# Pipeline steps:
# Generate plan
# Remove ANSI colour codes
# Generate state mv commands
# Strip any moves of numbered instances of a resource (i.e. from using count)
@toolness
toolness / git_branch_and_docker_machine_prompt.sh
Created September 15, 2016 14:23
Bash script to add git branch and docker machine info to prompt
#! /bin/bash
# Most of this is taken from:
#
# https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
#
# Just modified it to also include the current docker machine being
# used, if any.
parse_git_branch() {
# Strips the body out of a document. Quick and dirty, assumes ARGV is a real directory with markdown or YAML files in it.
# I hard coded the directory and am not really a rubyist so there's a chance I screwed up this ARGV thing.
#!/usr/bin/env ruby
require 'yaml'
files = Dir.glob("#{ARGV[0]}/*")
for file in files
yaml = YAML.load(File.read(file))
File.open(file, 'w') { |f|
f.write(yaml.to_yaml + "---")
}
@maxvt
maxvt / infra-secret-management-overview.md
Last active February 28, 2024 20:53
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

USDigitalRegistry Government.Github GSA.github.registry GovCode.org
18f 18f 18f 18F
ACME-Climate
adl-aicc adl-aicc
adlnet adlnet adlnet adlnet
afrl afrl afrl afrl
afseo afseo
arcticlcc arcticlcc arcticlcc
ARM-DOE ARM-DOE ARM-DOE
BBGInnovate BBGInnovate BBGInnovate
@LeonardoCardoso
LeonardoCardoso / gitzip.sh
Last active October 9, 2023 22:38
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o $@.zip HEAD
}
#... gitzip ZIPPED_FILE_NAME
# actual public radio stations
https://github.com/nypublicradio
https://github.com/KQED
https://github.com/SCPR
https://github.com/stlpublicradio
https://github.com/thebirn
https://github.com/michiganradio
https://github.com/kuscinteractive
https://github.com/klruweb
https://github.com/KPBS
@benbalter
benbalter / jekyll-csv.rb
Created May 27, 2014 22:06
Converts `.csv` files in a `_csvs` directory of a Jekyll site to `site.data` content
require 'csv'
module JekyllCsv
class Generator < Jekyll::Generator
def generate(site)
dir = File.expand_path "_csvs", site.source
return if site.safe && File.symlink?(dir)
entries = Dir.chdir(dir) do
Dir['*.csv']