Skip to content

Instantly share code, notes, and snippets.

View janl's full-sized avatar
🛋️
Drop ICE

Jan Lehnardt janl

🛋️
Drop ICE
View GitHub Profile
var view = {
foo: 1,
bar: {
baz: 2,
quux: 3
}
}
var template = "{{foo}} {{bar.baz}} {{bar.quux}}";
diff --git a/share/www/script/test/cookie_auth.js b/share/www/script/test/cookie_auth.js
index 066af85..4efde32 100644
--- a/share/www/script/test/cookie_auth.js
+++ b/share/www/script/test/cookie_auth.js
@@ -28,8 +28,13 @@ couchTests.cookie_auth = function(debug) {
};
var username1 = username.replace(/[0-9]$/, "");
var password = pws[username];
- //console.log("Logging in '" + username1 + "' with password '" + password + "'");
- T(CouchDB.login(username1, pws[username]).ok);
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index 38dd98e..bfd72de 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -212,7 +212,18 @@ handle_config_req(Req) ->
% PUT /_config/Section/Key
% "value"
handle_approved_config_req(#httpd{method='PUT', path_parts=[_, Section, Key]}=Req, Persist) ->
- Value = couch_httpd:json_body(Req),
+ Value = case Section of
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index 38dd98e..6ee49e0 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -212,7 +212,12 @@ handle_config_req(Req) ->
% PUT /_config/Section/Key
% "value"
handle_approved_config_req(#httpd{method='PUT', path_parts=[_, Section, Key]}=Req, Persist) ->
- Value = couch_httpd:json_body(Req),
+ Value = case Section of
+get_unhashed_admins() ->
+ lists:filter(
+ fun({_User, "-hashed-" ++ _}) ->
+ false; % already hashed
+ ({_User, "-pbkdf2-" ++ _}) ->
+ false; % already hashed
+ ({_User, _ClearPassword}) ->
+ true
+ end,
+ couch_config:get("admins")).
Put https://github.com/git/git/blob/master/contrib/completion/git-completion.bash into your $PATH
It has instructions how to set up your PS1:
I do:
> cat .bashrc
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\u@\h \w$(__git_ps1 " (%s)") \[\e[m\]\n> '
export PS1
> mvn test
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building CouchbaseMock 0.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.2:resources (default-resources) @ CouchbaseMock ---
[INFO] Using encoding: 'UTF-8' to copy filtered resources.
[INFO]
@janl
janl / otsbjs.md
Created May 24, 2012 11:40
Open Tech School Berlin JS

In the spirit of Railsgirls Berlin, we want to start a programming education group for JavaScript. We need your help to get all the coaching done.

If you are interested in coaching JavaScript, fork this gist and add yourself or leave your contact data in a comment:

asdasd
@janl
janl / gist:3110170
Created July 14, 2012 09:23
CoUp Coffee Chemex Guide

Chemex Quick Guide

Not this is rocket sience :)

Water

Fill the water heater with a finger more than 1 liter of water. Set it on its power-base, hit the button that’s all the way out on the handle. This starts the heating process. Now hit the “minus” (“-”) button so you see a red light on the 90° marker. Let it heat up. In the meantime:

Beans