Skip to content

Instantly share code, notes, and snippets.

View fancyremarker's full-sized avatar

Frank Macreery fancyremarker

  • Aptible
  • New York
View GitHub Profile
@fancyremarker
fancyremarker / team-sync.rb
Last active August 29, 2015 14:06
Sync a (non-Owners) GitHub team with all org repos
#!/usr/bin/env ruby
# Usage: ruby team-sync.rb aptible team
require 'octokit'
org_login = ARGV[0]
team_slug = ARGV[1]
print 'Username: '
username = $stdin.gets.chomp
@fancyremarker
fancyremarker / slack-notifications-sync.rb
Created November 21, 2014 19:41
Sync all an org's repos with Slack notifications, specifying individual events to subscribe to
#!/usr/bin/env ruby
# Usage: ruby slack-notifications-sync.rb aptible event [event event ...]
# Supported events:
# * commit_comment
# * create
# * delete
# * deployment
# * deployment_status
# * download
# * follow
@fancyremarker
fancyremarker / huboard-cleanup.rb
Created December 3, 2014 15:24
Script to clean up HuBoard labels (e.g., for moving to Waffle)
#!/usr/bin/env ruby
# Usage: ruby huboard-cleanup.rb ORG_HANDLE
require 'octokit'
org_login = ARGV[0]
events = ARGV[1..-1]
print 'Username: '
username = $stdin.gets.chomp
@fancyremarker
fancyremarker / catskills-filter.rb
Created December 26, 2014 02:11
Filter NYS DEC trail maps to a given map circle (e.g., Catskills Region)
#!/usr/bin/env ruby
# Run on http://www.dec.ny.gov/maps/hikingtrailslink.kmz
# Also: to get rid of waypoints, leaving only routes
# sed -i 's/<MultiGeometry><Point>.*/<MultiGeometry>/' OUTFILE
require 'openssl'
require 'geokit'
INPUT = ARGV[0]
@fancyremarker
fancyremarker / 0-dump-tickets
Last active February 7, 2022 07:53
dump-tickets: Dump all your Zendesk ticket summaries to a single HTML file
#!/usr/bin/env ruby
# gem install -N zendesk_api
require 'zendesk_api'
require 'truncate_html'
require 'active_support'
require 'active_support/core_ext'
require 'cgi'
require 'erb'
@fancyremarker
fancyremarker / print-container-host-port.rb
Created February 18, 2015 20:56
[:octopus:] Grab an app container's internal host and port from the Aptible API
require 'aptible/auth'
require 'aptible/api'
HANDLE = 'your-app'
EMAIL = '[email protected]'
PASSWORD = ''
token = Aptible::Auth::Token.create(email: EMAIL, password: PASSWORD)
app = Aptible::Api::App.all(token: token).find do |app|
app.handle == HANDLE
@fancyremarker
fancyremarker / export-hc-articles.rb
Created March 18, 2015 12:44
Export (and delete) all Zendesk HC Articles
#!/usr/bin/env ruby
require 'zendesk_api'
require 'active_support'
require 'active_support/core_ext'
# https://github.com/zendesk/zendesk_api_client_rb/issues/175
module ZendeskAPI
class Article < Resource; end
class Section < Resource; end
{
"host_groups": [
{
"name": "master",
"components": [
{
"name": "NAMENODE"
},
{
"name": "DATANODE"
@fancyremarker
fancyremarker / sync-waffle.rb
Last active August 29, 2015 14:19
[:octopus:] Sync Waffle sources with all repos for an org
#!/usr/bin/env ruby
# ruby sync-waffle.rb aptible aptible/support
require 'octokit'
require 'faraday'
require 'json'
org_login = ARGV[0]
waffle_project = ARGV[1]
@fancyremarker
fancyremarker / intercom-userstyle.css
Last active August 29, 2015 14:19
Custom userstyle for intercom.io (narrow screens)
.pl_app_header, .pl_inbox_search_box, .conversation__inbox__current-profile, .conversation__inbox__list-filter .u__right {
display: none;
}
body {
min-width: 800px!important;
}
.pl_secondary_nav_wrapper {
min-width: 800px!important;