Skip to content

Instantly share code, notes, and snippets.

package raindrops
import (
"bytes"
"fmt"
)
func Convert(v int) string {
fs := findRelevantFactorsFor(v)
return formatFactorsOf(v, fs)
module SomeRequest
class Real
def do_something
RequestCommon.base_request(...)
end
end
end
module Fog
module Rackspace
class Monitoring
class Real
def list_entities(options={})
request(
:expects => [200, 203],
:method => 'GET',
:path => 'entities',
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]
# IDENTITY
require 'fog/openstackcommon/identity'
require 'fog/openstackcommon/services/identity_v1'
require 'fog/openstackcommon/services/identity_v2'
@elight
elight / Gemfile
Last active August 29, 2015 13:59
source 'https://rubygems.org'
gem 'fog', '~> 1.20.0'
gem 'pry'
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?
require 'rubygems'
require 'bundler/setup'
require 'fog/rackspace'
require 'pry'
provider_config = {
:provider => 'rackspace',
:rackspace_username => ENV['RACKSPACE_USERNAME'],

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.

// illegal
grid := [][]int{
{1, 0, 1},
{0, 1, 0},
{1, 0, 1}
}
// legal
grid := [][]int{