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
sudo purge |
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
caffeinate -t 3600 |
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
# SSH key on OS X | |
ssh-add -K |
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
require 'aws-sdk-opsworks' | |
client = Aws::OpsWorks::Client.new(region: 'us-east-1') | |
stacks = client.describe_stacks.stacks | |
layers = stacks.map { |stack| client.describe_layers(stack_id: stack.stack_id).layers }.compact | |
rails_app_layers = layers.detect { |layer| layer.shortname == 'rails-app' } | |
rails_app_layers.each do |layer| | |
stack = stacks.detect { |stack| stack.stack_id == layer.stack_id } |
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
require 'aws-sdk-opsworks' | |
client = Aws::OpsWorks::Client.new(region: 'us-east-1') | |
stacks = client.describe_stacks.stacks | |
stacks.each do |stack| | |
custom_json = JSON.parse(stack.custom_json) | |
next unless custom_json['nodejs'] | |
puts <<-END_OF_STRING |
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
require 'octokit' | |
TITLE = 'example title' | |
LABEL = 'ready to merge' | |
COMMENT = '+B' | |
client = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
pulls = client.list_issues.select { |issue| | |
issue.pull_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
require 'octokit' | |
def client | |
Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
end | |
def create_pull_request(repo, head, options = {}) | |
ref = client.ref(repo, "heads/#{head}") | |
commit = client.commit(repo, ref.object.sha) | |
title = options[:title] || commit.commit.message |
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
require 'bundler/cli' | |
require 'git' | |
require 'octokit' | |
BRANCH_NAME = 'gem-updates' | |
COMMIT_MESSAGE = 'Update gems' | |
# ASSIGNEE = 'pengwynn' # update to assing pull request | |
git = Git.open(Dir.pwd) | |
github = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) |
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
require 'active_support/all' | |
require 'fileutils' | |
require 'pathname' | |
root = Pathname.pwd | |
code_folder = root.join('lib') | |
spec_folder = root.join('spec') | |
code = Dir[code_folder.join('**/*.rb')].map { |file| file[(code_folder.to_s.length+1)..-('.rb'.length+1)] } | |
specs = Dir[spec_folder.join('**/*_spec.rb')].map { |file| file[(spec_folder.to_s.length+1)..-('_spec.rb'.length+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
require 'octokit' | |
LABELS = [{ name: 'almost ready to merge', color: 'bfe5bf' }, | |
{ name: 'dependency missing', color: 'fbca04' }, | |
{ name: 'do not merge', color: 'e11d21' }, | |
{ name: 'ready to merge', color: '0e8a16' }, | |
{ name: 'refactoring expected', color: 'fbca04' }, | |
{ name: 'work in progress', color: 'fbca04' }] | |
repository = ARGV[0] |
OlderNewer