This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subset_roles = set() | |
for this_role, _ in roles_sorted_by_perms_asc: | |
for other_role, other_perms in roles_to_perms.items(): | |
if this_role == other_role: | |
continue | |
this_perms = roles_to_perms[this_role] | |
if this_perms.issubset(other_perms): | |
subset_roles.add(this_role) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
roles_sorted_by_perms_asc = sorted(perms_counts.items(), | |
key=lambda x: x[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
roles_to_perms = collections.defaultdict(set) | |
perms_to_roles = collections.defaultdict(set) | |
perms_counts = collections.defaultdict(int) | |
unique_perms = set() | |
for role_name, role_data in raw_role_data.items(): | |
for perm in role_data.get('includedPermissions', tuple()): | |
roles_to_perms[role_name].add(perm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"roles/accessapproval.approver": { | |
"name": "roles/accessapproval.approver", | |
"title": "Access Approval Approver", | |
"description": "Ability to view or act...", | |
"includedPermissions": [ | |
"accessapproval.requests.approve", | |
"accessapproval.requests.dismiss", | |
"accessapproval.requests.get", | |
"Accessapproval.requests.list", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from googleapiclient import discovery | |
# Fetch most up to date role list and role descriptions from API | |
iam = discovery.build('iam', 'v1') | |
raw_role_data = {} | |
# Build initial request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="$HOME/.local/bin:$HOME/Projects/go/bin:$PATH" | |
export HISTSIZE=25000 | |
export HISTCONTROL=ignoreboth | |
export CLICOLOR=1 | |
export LSCOLORS=exfxcxdxbxexexabagacad | |
export PROMPT_COMMAND='history -a' | |
export GOPATH=$HOME/Projects/go | |
alias ls='ls -G' | |
alias ll='ls -lahG' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import functools | |
def retry(wait, retries=3, reraise=True): | |
""" Decorator retries a function if an exception is raised during function | |
invocation, to an arbitrary limit. | |
:param wait: int, time in seconds to wait to try again | |
:param retries: int, number of times to retry function. If None, unlimited | |
retries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.0</real> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# These keybindings are a combination of IntelliJ's OS X 10.5+ keybindings | |
# and additive ones from Pivotal's practice. And extended by @andre487 | |
# This file uses CoffeeScript Object Notation (CSON). | |
# If you are unfamiliar with CSON, you can read more about it here: | |
# https://github.com/bevry/cson#what-is-cson | |
# | |
# Project navigation | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://idaretolisten.org"><img height="200" width="300" src="https://s3-us-west-2.amazonaws.com/idaretolisten.org/images/campaign_sm.jpg"></a> | |