Skip to content

Instantly share code, notes, and snippets.

View gist:eefa0ee64c5ebae91260a237116df122
[notice] 2021-09-15T15:51:36.748239Z node1@127.0.0.1 <0.1433.0> ebbea2aab1 FOO1 [{total,6},{offset,4}]
{"rows":[]}
[notice] 2021-09-15T15:51:36.748278Z node1@127.0.0.1 <0.1433.0> ebbea2aab1 FOO2 {view_row,<<"foo">>,<<"doc2">>,null,undefined,undefined}
---
[notice] 2021-09-15T15:54:36.287647Z node1@127.0.0.1 <0.1489.0> cdb108a194 FOO1 [{total,6},{offset,4}]
[notice] 2021-09-15T15:54:36.287664Z node1@127.0.0.1 <0.1489.0> cdb108a194 FOO5 complete
[notice] 2021-09-15T15:54:36.287672Z node1@127.0.0.1 <0.1489.0> cdb108a194 FOO1 [{total,6},{offset,4}]
{"total_rows":12,"offset":8,"rows":[
View README
Python script to insert missing trackpoints while paused
From https://support.strava.com/hc/en-us/articles/216919277-Auto-Pause:
"We will do server-side resting time calculations (per above)unless
there are manual pause events. If there are manual pause events, we
assume that you want to control the time and will calculate moving
time with respect to timer time instead."
This script detects these gaps and inserts trackpoints representing
View ebtree.erl
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
% License for the specific language governing permissions and limitations under
@rnewson
rnewson / ebtree.erl
Created Jul 24, 2020
ebtree.erl with improved collation wrapper
View ebtree.erl
% Licensed under the Apache License, Version 2.0 (the "License"); you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
% License for the specific language governing permissions and limitations under
View example ddoc
{
"views": {
"foo": {
"map":"function(doc) { ... }",
"reduce":"function(keys,values,rereduce) { ... }"
},
"bar": {
"map":"function(doc) { ... }",
"reduce":"function(keys,values,rereduce) { ... }"
}
View gist:14a8175a295017ddf5d772331ea445c5
➜ ~ curl -gi 'http://foo:bar@localhost:15984/db1/_design/personen/_view/actief?keys=["10002","10003"]'
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: application/json
Date: Tue, 27 Aug 2019 10:53:16 GMT
Server: CouchDB/2.3.1-dirty (Erlang OTP/22)
Transfer-Encoding: chunked
X-Couch-Request-ID: 447c12072b
X-CouchDB-Body-Time: 0
View gist:260e113bdfe089b3029f088072008744
keyword -> org.apache.lucene.analysis.core.KeywordAnalyzer
simple -> org.apache.lucene.analysis.core.SimpleAnalyzer
whitespace -> org.apache.lucene.analysis.core.WhitespaceAnalyzer
arabic -> org.apache.lucene.analysis.ar.ArabicAnalyzer
bulgarian -> org.apache.lucene.analysis.bg.BulgarianAnalyzer
brazilian -> org.apache.lucene.analysis.br.BrazilianAnalyzer
catalan -> org.apache.lucene.analysis.ca.CatalanAnalyzer
cjk -> org.apache.lucene.analysis.cjk.CJKAnalyzer
chinese -> org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer
czech -> org.apache.lucene.analysis.cz.CzechAnalyzer
@rnewson
rnewson / chttpd_sup.erl.diff
Created Oct 15, 2018
change cloudant auth caching
View chttpd_sup.erl.diff
diff --git a/src/chttpd/src/chttpd_sup.erl b/src/chttpd/src/chttpd_sup.erl
index fe84b67eb..afdcbcb8d 100644
--- a/src/chttpd/src/chttpd_sup.erl
+++ b/src/chttpd/src/chttpd_sup.erl
@@ -80,20 +80,20 @@ maybe_replace(Key, Value, Settings) ->
end.
lru_opts() ->
- case config:get("chttpd_auth_cache", "max_objects") of
- MxObjs when is_integer(MxObjs), MxObjs > 0 ->
View clouseau-run
exec chpst -u dbcore \
java \
-server \
-Xmx6G \
-Dsun.net.inetaddr.ttl=30 \
-Dsun.net.inetaddr.negative.ttl=30 \
-Dlog4j.configuration=file:/opt/clouseau/etc/log4j.properties \
-cp /opt/clouseau/etc:/opt/clouseau/lib/* \
com.cloudant.clouseau.Main \
/opt/clouseau/etc/clouseau.ini
View gist:2d076a061c1af802ad056519ef25e52d
#!/bin/sh
curl -X PUT http://localhost:5984/_users/org.couchdb.user:rnewson -d '{"name":"rnewson", "roles":[], "type":"user", "password":"orange"}'