Skip to content

Instantly share code, notes, and snippets.


Brett Porter brettporter

View GitHub Profile
#!/usr/bin/env python
"""Set all repositories of a given GitHub organization name for a given user
to watching.
import argparse
import json
import requests
import os
brettporter /
Created Jan 3, 2017 — forked from adambyrtek/
Quick and dirty OmniOutliner to plain-text conversion
#!/usr/bin/env python
import xml.etree.ElementTree as ET
import sys
import re
class OutlinerParser:
def __init__(self):
self.indent = 0
self.is_note = False
View npm-shrinkwrap.json
"name": "shrinkwrap-dev-dependency-conflict",
"version": "1.0.0",
"dependencies": {
"ansi-regex": {
"version": "2.0.0",
"from": "ansi-regex@>=2.0.0 <3.0.0",
"resolved": ""
"ansi-styles": {

Keybase proof

I hereby claim:

  • I am brettporter on github.
  • I am brettporter ( on keybase.
  • I have a public key whose fingerprint is DA5D DD55 E69D E580 FE98 5E76 E136 088A 1824 BDC1

To claim this, I am signing this object:

View mount.iso.psm1
# Uses virtual disk driver for windows 7 or less
# Tries to use chocolatey to install imdisk
# Sample use case:
# Import-Module ".\mount.iso.psm1"
# Invoke-IsoExe "C:\test.iso" "setup.exe" "/passive"
function Mount-Iso([string] $isoPath)
if ( -not (Test-Path $isoPath)) { throw "$isoPath does not exist" }
brettporter / flush-amq-queues.rb
Created Oct 2, 2013
Remove a set of queues from ActiveMQ
View flush-amq-queues.rb
#!/usr/bin/env ruby
require 'json'
require 'httparty'
credentials = {
:username => 'admin',
:password => 'admin',
View gist:6758022
Error: Package: nodejs-npm-registry-client-0.2.28-1.el6.noarch (epel)
Requires: npm(semver) >= 2.1.0
Installing: nodejs-semver-2.0.10-1.el6.noarch (epel)
npm(semver) = 2.0.10
Error: Package: nodejs-request-2.21.0-1.el6.noarch (epel)
Requires: npm(form-data) < 0.1
Available: nodejs-form-data-0.1.1-1.el6.noarch (epel)
npm(form-data) = 0.1.1
Error: Package: nodejs-request-2.21.0-1.el6.noarch (epel)
Requires: npm(form-data) < 0.1
brettporter /
Last active Dec 23, 2015
Get all licenses in list of Bower dependencies using jq
# For each dependency's pkgMeta, get "license" if it exists, otherwise get the "type" field of each of "licenses", or "unknown" if that is also empty
# I'm sure there's a better way to do this with jq
bower list -jq | jq '.dependencies | to_entries[] | { (.key): .value | .pkgMeta | (.license // ((.licenses // [{type: "unknown"}])[] | .type)) }'
set -e
gem list --source $gem_repo -r -a -u --prerelease | awk '/^[a-z]/' | while read t1
name=`echo $t1 | perl -n -e '/^([^\s]+)/ && print $1'`
brettporter / fix_maven_conflicts.rb
Created Feb 2, 2012
Automatically resolve conflicts in Maven POMs after a merge
View fix_maven_conflicts.rb
#!/usr/bin/env ruby
require 'tempfile'
require 'optparse'
def parse_version(text)
if (text.match(/^\s*<version>\s*(.*?)\s*<\/version>\s*$/))