When not polishing his bio for conferences, Evan works as a Developer Advocate from the comfort of his apartment near Washington, D.C., organizes, if it can be called organized, the annual Ruby DCamp unconference that has never, in fact, been run within the borders of Washington, D.C., and attends entirely too many meetups.
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
package raindrops | |
import ( | |
"bytes" | |
"fmt" | |
) | |
func Convert(v int) string { | |
fs := findRelevantFactorsFor(v) | |
return formatFactorsOf(v, fs) |
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 SomeRequest | |
class Real | |
def do_something | |
RequestCommon.base_request(...) | |
end | |
end | |
end |
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 Fog | |
module Rackspace | |
class Monitoring | |
class Real | |
def list_entities(options={}) | |
request( | |
:expects => [200, 203], | |
:method => 'GET', | |
:path => 'entities', |
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
def request(params) | |
begin | |
response = @connection.request(params.merge({ | |
:headers => { | |
'Content-Type' => 'application/json', | |
'Accept' => 'application/json', | |
'X-Auth-Token' => @auth_token | |
}.merge!(params[:headers] || {}), | |
:path => "#{@path}/#{@tenant_id}/#{params[:path]}", | |
:query => params[:query] |
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
# IDENTITY | |
require 'fog/openstackcommon/identity' | |
require 'fog/openstackcommon/services/identity_v1' | |
require 'fog/openstackcommon/services/identity_v2' |
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
source 'https://rubygems.org' | |
gem 'fog', '~> 1.20.0' | |
gem 'pry' | |
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
def new(config = {}) | |
if config.respond_to?(:config_service?) && config.config_service? | |
cleaned_settings = config | |
else | |
cleaned_settings = handle_settings(config) | |
end | |
setup_requirements | |
svc = service | |
if Fog.mocking? |
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 'rubygems' | |
require 'bundler/setup' | |
require 'fog/rackspace' | |
require 'pry' | |
provider_config = { | |
:provider => 'rackspace', | |
:rackspace_username => ENV['RACKSPACE_USERNAME'], |
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
// illegal | |
grid := [][]int{ | |
{1, 0, 1}, | |
{0, 1, 0}, | |
{1, 0, 1} | |
} | |
// legal | |
grid := [][]int{ |