Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Light elight

  • Heroku
  • Washington, DC
View GitHub Profile
View openstackcommon.rb
# IDENTITY
require 'fog/openstackcommon/identity'
require 'fog/openstackcommon/services/identity_v1'
require 'fog/openstackcommon/services/identity_v2'
View Gemfile
source 'https://rubygems.org'
gem 'fog', '~> 1.20.0'
gem 'pry'
View service.rb
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?
View skeleton.rb
require 'rubygems'
require 'bundler/setup'
require 'fog/rackspace'
require 'pry'
provider_config = {
:provider => 'rackspace',
:rackspace_username => ENV['RACKSPACE_USERNAME'],
View bio.md

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.

View go_home_golang_ur_drunk.go
// illegal
grid := [][]int{
{1, 0, 1},
{0, 1, 0},
{1, 0, 1}
}
// legal
grid := [][]int{
View request_router.rb
module RequestRouter
ADMIN_REQUESTS = %w[
names
of_admin_methods
go_here
this_is_an_admin_method
]
def request(params)
View channels.go
package main
import "fmt"
func sum(a []int, c chan int) {
sum := 0
for _, v := range a {
sum += v
}
c <- sum // send sum to c
View you_can_do_that_whoa.go
func run() error {
return &MyError{
time.Now(),
"it didn't work",
}
}
View interface_composition.go
type Reader interface {
Read(b []byte) (n int, err error)
}
type Writer interface {
Write(b []byte) (n int, err error)
}
type ReadWriter interface {
Reader