Skip to content

Instantly share code, notes, and snippets.

View seanhandley's full-sized avatar
🧀
Eating cheese

Sean Handley seanhandley

🧀
Eating cheese
View GitHub Profile
0.0.0.0 r4.sn-cxaaj5o5q5-tt16.googlevideo.com
0.0.0.0 r3.sn-q5u5bgv02-3c26.googlevideo.com
0.0.0.0 r12.sn-bvvbax-hn26.googlevideo.com
0.0.0.0 r7.sn-w5nuxa-o536.googlevideo.com
0.0.0.0 r1.sn-4g5e6n76.googlevideo.com
0.0.0.0 r3.sn-4g5e6n76.googlevideo.com
0.0.0.0 r4.sn-4g5e6n76.googlevideo.com
0.0.0.0 r5.sn-4g5e6n76.googlevideo.com
0.0.0.0 r6.sn-4g5e6n76.googlevideo.com
0.0.0.0 r1.sn-nx5e6n76.googlevideo.com
module H3
class Resolution
extend FFI::DataConverter
native_type FFI::Type::INT
RES_RANGE = 0..15
class << self
def to_native(value, _context)
failure unless value.is_a?(Integer) && RES_RANGE.cover?(value)
typedef :ulong_long, :h3_index

Smoky Red Pepper Chicken

Feeds 4.

Goes beautifully with green beans and rice or new potatoes.

Ingredients

  • 3 x Chicken breast fillets
  • 200ml Double cream
@seanhandley
seanhandley / docker-compose.yml
Last active April 9, 2024 04:05
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@seanhandley
seanhandley / lb.rb
Created August 26, 2017 13:35
Build a load balancer with Fog
require 'fog/openstack'
conn = {
openstack_auth_url: ENV["OS_AUTH_URL"],
openstack_username: ENV["OS_USERNAME"],
openstack_api_key: ENV["OS_PASSWORD"],
openstack_project_name: ENV["OS_PROJECT_NAME"],
openstack_domain_id: ENV["OS_USER_DOMAIN_NAME"]
}
@seanhandley
seanhandley / fizzbuzz.ex
Last active September 20, 2017 14:45
FizzBuzz in Elixir / The Magic of Functional Pattern Matching
fb = fn
0, 0, _ -> "FizzBuzz"
0, _, _ -> "Fizz"
_, 0, _ -> "Buzz"
_, _, x -> x
end
fizzbuzz = fn (n) -> fb.(rem(n, 3), rem(n, 5), n) end
fizzbuzz.(10) # => "Buzz"
module CustomAttributes
def attributes(*attrs)
attrs.each do |sym|
define_method sym do
instance_variable_get("@#{sym}")
end
define_method :"#{sym}=" do |v|
instance_variable_set("@#{sym}", v)
end
end
@seanhandley
seanhandley / cable.yml
Created February 15, 2017 11:19
Using Redis Auth with ActionCable
default: &default
adapter: redis
url: redis://localhost:6379/1
development:
<<: *default
test:
<<: *default
magnum cluster-show k8s-cluster
+--------------------+------------------------------------------------------------+
| Property | Value |
+--------------------+------------------------------------------------------------+
| status | CREATE_COMPLETE |
| uuid | cff82cd0-189c-4ede-a9cb-2c0af6997709 |
| stack_id | 7947844a-8e18-4c79-b591-ecf0f6067641 |
| status_reason | Stack CREATE completed successfully |
| created_at | 2016-05-26T17:45:57+00:00 |