This file contains hidden or 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' | |
| class BucketSyncService | |
| attr_reader :from_bucket, :to_bucket, :logger | |
| attr_accessor :debug | |
| DEFAULT_ACL = "public-read" | |
| def initialize(from_bucket, to_bucket) |
This file contains hidden or 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
| $ brew update | |
| $ brew install hive |
This file contains hidden or 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' | |
| require 'aws-sdk' | |
| ACCESS_KEY_ID='access key' | |
| SECRET_ACCESS_KEY='secret access key' | |
| TABLE='table name' | |
| MAX_ITEMS=100 | |
| AWS.config({ | |
| access_key_id: ACCESS_KEY_ID, |
This file contains hidden or 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
| module FaradayMiddleware | |
| class XmlRequest < Faraday::Middleware | |
| dependency do | |
| require 'active_support/all' | |
| end | |
| def call(env) | |
| if env[:method] == :post | |
| body = env[:body] | |
| first_key = body.keys.first |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # | |
| file_location = File.dirname(__FILE__) | |
| $:.unshift(File.join(file_location, 'aws-sdk-for-ruby', 'lib')) | |
| require 'yaml' | |
| require 'aws-sdk' | |
| require 'Date' | |
| aws_config_file = File.join(File.dirname(__FILE__), 'aws_config.yml') |
This file contains hidden or 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
| #!/usr/bin/ruby | |
| require 'rubygems' | |
| require 'gruff' | |
| # Let's hack almost everything | |
| g = Gruff::Bar.new('800x700') # Define a custom size | |
| g.sort = false # Do NOT sort data based on values | |
| g.maximum_value = 40 # Declare a max value for the Y axis |