Skip to content

Instantly share code, notes, and snippets.

View dieswaytoofast's full-sized avatar

Mahesh Paolini-Subramanya dieswaytoofast

View GitHub Profile
@dieswaytoofast
dieswaytoofast / F00.md
Created November 29, 2016 10:56
Demo Gist

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

perform_gc(Handler) ->
safe_cast(Handler, {perform_gc}).
init([{Party, _Client} = Account]) ->
% something here
{ok, Timer} = timer:apply_interval(?ACCOUNT_GC_TIMER, ?MODULE, perform_gc, [self()]),
State = #state{gc_timer = Timer}.
handle_cast({perform_gc}, State) ->
garbage_collect(),
{message,
[{1, message_type, string, required, {json, validate_binary}, "", []},
{2, version, 'version', required, {json, validate_integer_in_list}, {proper, {required_integer_in_list}}, {int64, [1], 1}},
{3, payload, 'payload', required, {ubic_validate, validate}, "", []},
]}
cloudi_service_init(Args, _Prefix, Dispatcher) ->
Defaults = [{name, "foobar"}],
?LOG_DEBUG("Args:~p~n", [Args]),
[Name] = cloudi_proplists:take_values(Defaults, Args),
cloudi_service:subscribe(Dispatcher, Name),
{ok, #state{name = Name
}}.
cloudi_service_handle_request(_Type, _Name, _Pattern, _RequestInfo, Request,
_Timeout, _Priority, _TransId, _Pid,
@dieswaytoofast
dieswaytoofast / IndexOf.java
Created November 12, 2012 23:13
Oh Joyous Code, thy authorship is known to me...
public void persistSentFax( FaxSendEvent e ) throws
ApplicationException, Exception {
// XXX jwh - this logic really, really, REALLY needs to be broken out. I'M SERIOUS.
// I mean, this is getting ugly now. Really ugly. Uglier than your mom. And that's _ugly_.
// It would probably just be fine for JAKE (clarifying the antecedent just so you know that
// it's YOUR mom I'm talking about, not MINE.) to do one prepared statement that gets reused
String tmp = getSession().getVars().get(
PhoneplexServlet.APPLICATION_CLIENT_OID );