Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@churchofthought
churchofthought / gist:5202041
Last active October 23, 2017 13:25 — forked from anonymous/gist:5202029
Y Combinator Explained
I just finally had my mind snap into place with understanding of the Y Combinator. Most explanations I read, even the ones using JS, didn't make much sense and were overly long so here follows my own, much simpler explanation. I will be using JS.
We have fibonacci to start with, very simple recursive function.
It's fixed points are 0 and 1, fib(0) = 0, and fib(1) = 1
That's all a fix point means, when the f(x) == x
They are important because they are the only values at which recursion can cease.
Our Fibonacci Function
======================
@bkeepers
bkeepers / twithubbers.sh
Created June 4, 2013 14:29
Create a list of GitHubbers and follow all of them.
#!/bin/sh
#
# Requires the `t` gem: https://github.com/sferik/t
#
# gem install t
#
if [ -z $(t lists | grep -i githubbers) ]
then
t list create GitHubbers
@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']
# 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
@LeonardoCardoso
LeonardoCardoso / gitzip.sh
Last active December 22, 2024 21:31
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o [email protected] HEAD
}
#... gitzip ZIPPED_FILE_NAME
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
@maxvt
maxvt / infra-secret-management-overview.md
Last active February 3, 2025 06:11
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.

# 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 + "---")
}
@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() {
@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)