Skip to content

Instantly share code, notes, and snippets.

sets:fold(fun (Id, ok) ->
supervisor:terminate_child(?MODULE, Id),
supervisor:delete_child(?MODULE, Id),
ok
end, ok, Kill),
Port = case os:getenv("WEBMACHINE_PORT") of
false -> 8000;
AnyPort -> AnyPort
end,
@elight
elight / gist:6001132
Created July 15, 2013 16:01
Warning to potential no-shows for DCamp 2012
NEW POLICY THIS YEAR: If you are registered for DCamp, do not cancel your registration within two weeks of the event, and are a no-show for the event, you will not be permitted to attend for another two years. This policy has been put in place for all of the reasons described below.
---
Every year, we have a few cancellations. And we also have no-shows.
DCamp is free ("as in beer") for the community and paid for 100% by sponsors. We're a fairly small event, all in all, of just 78 people. As participants, we define the event for one another.
If you're a no-show then the event is weaker for it. That's one less person contributing to DCamp sessions, enriching the community. And it's one less person using the services and supplies paid for by the sponsors.
1) Authentication A user, once registered, is authenticated
Failure/Error: click_button "Register"
ArgumentError:
wrong number of arguments (2 for 1)
# ./spec/features/auth_spec.rb:9:in `block (2 levels) in <top (required)>'
@elight
elight / gist:5473485
Last active December 16, 2015 17:50
# Code of Conduct
## Front matter
I am proud to say that, while I have asked repeatedly over the years, I have never heard of a single incident where a participant has harassed another.
; defpage is one of a few different macros generated and used by the Grinder
(defpage page1
; Code to invoke http requests using its internal HTTPConnection class
... )
(defpage page2 ...)
(defpage page3 ...)
(defn run []
(page1)
(page2)
@elight
elight / gist:4370908
Last active December 10, 2015 02:58
FP_OO Chapter 10.9 Exercise Prerequisites:
1. Install leinengen
I hope you're using this already to run your repl...
2. lein new playground
This will create you a directory called playground
class User
after_save do
if name_changed?
notify_listeners(:name, self)
end
end
def self.register_listener(listener)
# ...
end
class User
def name=(value)
@name = value
end
end
class ClientProxy
def push_change_to_client(message, source)
# ...
end
@elight
elight / worker.rb
Created August 6, 2012 22:16
Partially elided patch to Resque to mitigate monkey patching need to support extra hooks
module Resque
def self.hook_responders
@hook_responders ||= [self]
@hook_responders
end
def self.register_hook_responder(responder)
hook_responsers << responder
end