Skip to content

Instantly share code, notes, and snippets.

View anowak's full-sized avatar

Artur Nowak anowak

View GitHub Profile
@anowak
anowak / .block
Last active November 15, 2017 16:51 — forked from mbostock/.block
Zoomable Circle Packing
license: gpl-3.0
height: 960
@anowak
anowak / connected_continuous_clients.erl
Last active November 18, 2016 10:37
Get information about which users have open continuous change feeds to CouchDB
% To be executed in Erlang shell
% E.g. connect with erl -sname shell -setcookie $(cat /usr/local/var/lib/couchdb/.erlang.cookie) -remsh couch@$(hostname)
Get_user_for_changes_process = fun(ProcessData) ->
AuthSession = proplists:get_value("AuthSession", proplists:get_value(mochiweb_request_cookie, ProcessData)),
case AuthSession of
undefined -> "not_authenticated_with_cookie";
Cookie ->
SessionInfo = couch_util:decodeBase64Url(Cookie),
[User, _, _] = re:split(SessionInfo, ":", [{return, list}, {parts, 3}]),
User

Keybase proof

I hereby claim:

  • I am anowak on github.
  • I am anowak (https://keybase.io/anowak) on keybase.
  • I have a public key ASASbu3oSmHaW2WtiefL2kEdrJOSmFcCCuC2OM1vbr6rXwo

To claim this, I am signing this object:

class Test extends Model
initialize: ->