This assumes the account has already been connected to Context.IO. See http://context.io/docs/lite/users/email_accounts for the field definitions of :id and :label
POST /users/:id/email_accounts/:label
- 200 - Account added and being scanned
| def let_once(method, &block) | |
| before(:all) do | |
| @let_once ||= {} | |
| @let_once[method] = block.call | |
| end | |
| let(method) do | |
| @let_once[method] | |
| end | |
| end |
This assumes the account has already been connected to Context.IO. See http://context.io/docs/lite/users/email_accounts for the field definitions of :id and :label
POST /users/:id/email_accounts/:label
| pub trait Fooable { | |
| pub fn foo(); | |
| } | |
| pub impl Fooable for String { | |
| pub fn foo() { | |
| println!("Hello world"); | |
| } | |
| } |
| gem 'faraday' | |
| gem 'faraday_middleware' |
| -- This will need to be built and put on the machine you're running Hive from | |
| add jar json-serde-1.1.9.3-SNAPSHOT-jar-with-dependencies.jar; | |
| -- Creates the table based on the JSON schema | |
| CREATE TABLE json_nested_test ( | |
| metadata struct<uuid:string,md5_email:string,received_at:string,message_id:string,from_domain:string,message_signature:string,provider:string>, | |
| headers map<string,struct<length:string,match_counts:map<string,string>,text_hash_counts:array<array<string>>,address_hashes:array<string>>>, | |
| parts array<struct<mime_type:string,length:string,stripped_length:string,match_counts:map<string,string>,urls:array<struct<domain:string,sha:string>>,images:array<struct<domain:string,sha:string,pixel_count:string>>,text_hash_counts:array<array<string>>>>, | |
| attachments array<struct<mime_type:string,bytesize:string,filename_sha:string,filetype:string>> | |
| ) |
Distributed computing environments face two significant problems
An ideal solution would satisfy a couple objectives
| # This is for building a JSON request to the monitoring service | |
| MonitorClient.group(name: 'my group') do |g| | |
| g.add_watch(name: 'Something fragile') do |w| | |
| w.description = 'information about watch' | |
| w.docs = 'http://triage.com' | |
| w.owners = ['[email protected]'] | |
| w.metric = MonitorClient::Metric::Graphite.new(target: 'foo.bar.baz') | |
| w.policy = never_be_zero | |
| w.add_action MonitorClient::Action::Email.new |
| # Basics - if you define an enumerable, you can evaluate it lazily | |
| class Foo | |
| include Enumerable | |
| def each(&block) | |
| (1..20).to_a.each do |i| | |
| yield i | |
| puts "yielded #{i}" | |
| end | |
| end | |
| end |
| def subnet_ids | |
| # TODO: Changed `availability_zones` key to `subnets` for backwards compatibility. | |
| # Need to change it back here and in the config after all components and stacks | |
| # are ready. | |
| availability_zones.map do |az| | |
| subnet_id(az) | |
| end.compact | |
| end |
| class ResponseObject | |
| def initialize | |
| @handlers = Hash.new { [] } | |
| yield self | |
| end | |
| def do(state, *args) | |
| @state = state | |
| @args = args | |
| end |