Skip to content

Instantly share code, notes, and snippets.

@bokner
bokner / digest_auth.erl
Created April 10, 2010 16:26
Erlang module implementing HTTP digest auth on client side
%% Author: bokner
%% Created: Apr 10, 2010
%% Description: HTTP digest authentication
%% Note: the code follows the informal explanation given on Wikipedia.
%% Note: the test/0 function doesn't intend to send a proper data to webdav service,
%% it just shows how to pass the authorization.
%% Disclaimer: Use on your own risk. The author disclaims any liability
%% with regard to using this code.
-module(digest_auth).
@hallettj
hallettj / global-variables-are-bad.js
Created February 14, 2009 21:15
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {