Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@afeld
afeld / authorizations.rb
Created April 21, 2016 16:22
get a list of all service hooks across an organization in GitHub
require 'octokit'
require 'set'
TOKEN = ENV['GITHUB_TOKEN'] || (raise "Please set GITHUB_TOKEN.")
ORG = ENV['ORG'] || (raise "Please set ORG as the organization name.")
Octokit.auto_paginate = true
client = Octokit::Client.new(access_token: TOKEN)
# default to an empty Set for each key
@afeld
afeld / README.md
Created March 1, 2016 05:38
Cloud Foundry Summit 2016 talk proposal: How to Build Platforms and Influence People

https://www.cloudfoundry.org/community/summits/program/cfp/?summitId=10016

Abstract

Any platform is going to have a multitude of different users with different needs. As the number of users and applications on your platform grow, it will be increasingly difficult to support all of them. Cloud Foundry provides a consistent base for your users to deploy to, but there is still a lot of work that needs to happen around any particular production application: CDNs, logging, vulnerability scanning, alerts, and on and on. In other words: it is still too easy for your users to build fragile, non-production-ready applications.

In this talk, Aidan Feldman will cover how platforms can better support the needs of their users by building in best practices, providing smart defaults, and making the “correct” path the easy path. We will look at concrete examples built into Cloud Foundry, and show some choices made the building of cloud.gov to reduce the cognitive burden on developers, and better ensure the success of wha

@afeld
afeld / slack_reactions.js
Last active September 18, 2021 19:59
get emoji reactions for a message in Slack – unfortunately their API "might not always contain all users that have reacted". limited to 50 as of 2/12/16.
'use strict';
const Promise = require('bluebird');
const WebClient = require('slack-client').WebClient;
const token = process.env.SLACK_API_TOKEN;
if (!token) {
throw "Please set SLACK_API_TOKEN";
}
@afeld
afeld / keybase.md
Created February 5, 2016 04:56
keybase.md

Keybase proof

I hereby claim:

  • I am afeld on github.
  • I am afeld (https://keybase.io/afeld) on keybase.
  • I have a public key ASDYti7kN2zr4J2xFG1umSCfBtgoBNKRrGK6D43QXL6duAo

To claim this, I am signing this object:

@afeld
afeld / private_repos.rb
Created January 22, 2016 19:35
private GitHub repositories in an organization
require 'octokit'
Octokit.auto_paginate = true
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
repos = client.organization_repositories('18F')
private_repos = repos.select(&:private)
private_repos.sort_by!(&:name)
private_repos.each do |repo|
puts [
@afeld
afeld / 18fers.rb
Last active September 14, 2015 16:43
list 18F team members
require 'octokit'
Octokit.auto_paginate = true
client = Octokit::Client.new(access_token: ENV['GITHUB_TOKEN'])
teams = client.organization_teams('18F')
team = teams.find{|team| team.slug.downcase == '18f' }
members = client.team_members(team.id)
members.each do |member|
puts member.login
end
@afeld
afeld / gist:10d85bb67c3cc8c7b7bb
Last active December 29, 2020 20:40
fix orientation for all images in an S3 bucket
# Reads from EXIF data and applies the appropriate rotation. Requires AWS CLI and ImageMagick.
# To use, replace `BUCKET` and run in your terminal.
mkdir -p BUCKET/upright
cd BUCKET
aws s3 sync s3://BUCKET .
find . -name "*.jpg" -exec convert {} -auto-orient upright/{} \;
aws s3 sync . s3://BUCKET --acl public-read
@afeld
afeld / contributions.rb
Last active August 29, 2015 14:20
GitHub org outside contribution stats
# goals:
#
# * find how frequently others contributed (issues or whatever)
# * how many contributors there are
#
# relevant links:
#
# * https://gist.github.com/afeld/017862706282c10edb6e
# * http://octoboard.com/
# * http://bitergia.com/index.html
@afeld
afeld / gist:0500a73578bc29906e7c
Last active May 19, 2016 10:48
Running Our Own Heroku talk proposal

Title

Running Our Own Heroku ...and are we out of our minds?

Description

18F is a development shop within the federal government, which builds applications and tools for other agencies. Working in and for the federal government, 18F has some fairly unique requirements and constraints around hosting. This talk will cover the considerations of our DevOps team, the different tools we have tried, and our current work moving to a platform-as-a-service (PaaS).


@afeld
afeld / gist:fb9b2a36f9a7b58b63d7
Created December 17, 2014 22:09
add multiple people on Trello
emails = %w(
...
)
require 'rest_client'
ORG = 'YOUR_ORG_SHORTNAME'
KEY = 'YOUR_KEY'
# visit this URL w/ your key replaced to get a token
# https://trello.com/1/authorize?key=KEY&expiration=1day&response_type=token&scope=read,write