Skip to content

Instantly share code, notes, and snippets.

@kyletolle
kyletolle / hash_constant.rb
Created October 24, 2013 20:38
hash constant example
irb(main):017:0> HASH = { a: a, b: b }
=> {:a=>#<Object:0x007f892b9a3b00>, :b=>#<Object:0x007f892b940af0>}
irb(main):018:0> HASH[:a] = Object.new
=> #<Object:0x007f892b9c3b58>
irb(main):019:0> HASH
=> {:a=>#<Object:0x007f892b9c3b58>, :b=>#<Object:0x007f892b940af0>}
irb(main):020:0> HASH[:c] = Object.new
=> #<Object:0x007f892b9d1b18>
irb(main):021:0> HASH = {}
(irb):21: warning: already initialized constant HASH
@kyletolle
kyletolle / hash_freeze.rb
Created October 24, 2013 20:34
hash freezing example
irb(main):007:0> a
=> #<Object:0x007f892b8e6208>
irb(main):008:0> a = Object.new
=> #<Object:0x007f892b93a1f0>
irb(main):009:0> b = Object.new
=> #<Object:0x007f892b940af0>
irb(main):010:0> c = Object.new
=> #<Object:0x007f89291125d8>
irb(main):011:0> h = { a: a, b: b, c: c }
=> {:a=>#<Object:0x007f892b93a1f0>, :b=>#<Object:0x007f892b940af0>, :c=>#<Object:0x007f89291125d8>}
@kyletolle
kyletolle / fulcrum-webhook-example.json
Last active December 23, 2015 07:19
Fulcrum Webhook JSON example
{
"webhook":{
"name":"Test Webhook",
"url":"http://example.com/webhook_endpoint",
"active":true,
"id":"c2178436-e8da-4630-a1a6-5e03c0880eca",
"created_at":"2013-09-17T20:18:10Z",
"updated_at":"2013-09-17T20:18:10Z"
}
}
@kyletolle
kyletolle / choice_list.update-parsed.txt
Last active December 23, 2015 06:59
choice_list.update sample event payload for Fulcrum Webhooks
{
id: "02a17aac-f875-49a4-931a-0e1f8558852d",
type: "choice_list.update",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Tree Size",
description: "Categories for Trees Based on SIze.",
id: "c50d3a63-f444-4677-8bbd-4685f7800e49",
created_at: "2013-09-21T19:30:32Z",
updated_at: "2013-09-21T19:31:03Z",
@kyletolle
kyletolle / choice_list.create-parsed.txt
Last active December 23, 2015 06:59
choice_list.create sample event payload for Fulcrum Webhooks
{
id: "138b54d0-4681-41b9-8efa-5b7cabd0eaa2",
type: "choice_list.create",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Tree Size",
description: "Categories for Trees Based on SIze.",
id: "c50d3a63-f444-4677-8bbd-4685f7800e49",
created_at: "2013-09-21T19:30:32Z",
updated_at: "2013-09-21T19:30:32Z",
@kyletolle
kyletolle / choice_list.delete-parsed.txt
Last active December 23, 2015 06:59
choice_list.delete sample event payload for Fulcrum Webhooks
{
id: "ca7baf27-e88b-47a8-988a-5b8f9eb4c889",
type: "choice_list.delete",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Tree Size",
description: "Categories for Trees Based on SIze.",
id: "c50d3a63-f444-4677-8bbd-4685f7800e49",
created_at: "2013-09-21T19:30:32Z",
updated_at: "2013-09-21T19:31:03Z",
@kyletolle
kyletolle / classification_set.delete-parsed.txt
Last active December 23, 2015 06:59
classification_set.delete sample event payload for Fulcrum Webhooks
{
id: "22b3ed8e-17dc-4557-b0d1-92030f3b2230",
type: "classification_set.delete",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Building Type",
description: "Categories for building types.",
id: "ff22c928-bb41-4360-acc1-aff44eeaa702",
created_at: "2013-09-21T19:27:06Z",
updated_at: "2013-09-21T19:27:25Z",
@kyletolle
kyletolle / classification_set.update-parsed.txt
Last active December 23, 2015 06:59
classification_set.update sample event payload for Fulcrum Webhooks
{
id: "86bd5c0b-da59-4fe8-bc82-664eb35fc456",
type: "classification_set.update",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Building Type",
description: "Categories for building types.",
id: "ff22c928-bb41-4360-acc1-aff44eeaa702",
created_at: "2013-09-21T19:27:06Z",
updated_at: "2013-09-21T19:27:25Z",
@kyletolle
kyletolle / classification_set.create-parsed.txt
Last active December 23, 2015 06:59
classification_set.create sample event payload for Fulcrum Webhooks
{
id: "0e7d69c7-94e9-40e2-b3b7-802c88c5fb47",
type: "classification_set.create",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Building Type",
description: "Categories for building types.",
id: "ff22c928-bb41-4360-acc1-aff44eeaa702",
created_at: "2013-09-21T19:27:06Z",
updated_at: "2013-09-21T19:27:06Z",
@kyletolle
kyletolle / form.delete-parsed.txt
Last active December 23, 2015 06:58
form.delete sample event payload for Fulcrum Webhooks
{
id: "42edfb16-cb13-41e1-857c-bbba57e7b072",
type: "form.delete",
owner_id: "00053caf-4b6e-4c86-88b6-64695895dffe",
data: {
name: "Intersections",
description: "Intersection in the city of Colorado Springs.",
bounding_box: null,
record_title_key: "94f8",
status_field: { },