Skip to content

Instantly share code, notes, and snippets.

ermouth ermouth

Block or report user

Report or block ermouth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nested2.js
{
init:[
'<div id="list"></div>'
],
data:{
data: [
{ idfield:'abc', desc: 'parent1', children: [ { id:'fgh', desc: 'child1' }, { id:'lmn', desc: 'child2' } ] },
{ idfield:'def', desc: 'parent2', children: [ { id:'xyz', desc: 'child1' } ] }
]
},
View Diff
({
"id": "cw.Sys.Diff",
"require": [{
"jsondiffpatch": "lib/diff.js"
}],
"params": {
},
"data": {
"cmd": "",
"title": "Diff",
@ermouth
ermouth / ddoc:query_server:protocol.rst
Last active Dec 21, 2017
CouchDB js rewrites QS protocol
View ddoc:query_server:protocol.rst
.. 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
@ermouth
ermouth / json_structure.rst
Last active Dec 9, 2015
CouchDB js rewrites – json_structure
View json_structure.rst
.. 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 viewMapValidator.js
function(doc){
// Validates ddoc map functions to prevent them
// from calling send(), getRow() and so on.
// Ddoc with this validate_doc_update must have
// property .Uglify with UglifyJS lib (tested for 2.4.15).
require("Uglify");
@ermouth
ermouth / rewrites.rst
Last active Dec 5, 2015
CouchDB js rewrites - I
View rewrites.rst
.. 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
@ermouth
ermouth / treematch.js
Last active Nov 16, 2015
Recursive pattern matcher for CouchDB
View treematch.js
(function () {
// matches.js
// ----------
// Powerful pattern matching for Javascript
//
// version : 0.5.1
// author : Nathan Faubion <nathan@n-son.com>
// repo : https://github.com/natefaubion/matches.js
// license : MIT
@ermouth
ermouth / b010.log
Created Oct 10, 2015
Barrel 010 build log
View b010.log
===> Cleaning out couch...
===> Cleaning out couch_changes...
===> Cleaning out couch_dbupdates...
===> Cleaning out couch_httpd...
===> Cleaning out couch_index...
===> Cleaning out couch_mrview...
===> Cleaning out couch_randomdoc...
===> Cleaning out couch_replicator...
===> Cleaning out geocouch...
===> Verifying dependencies...
@ermouth
ermouth / couch-rewrite-fn-penalties.js
Last active Sep 25, 2015
CouchDB query server js call penalties
View couch-rewrite-fn-penalties.js
// Tests process switching penalties for calling
// CouchDB query server js functions.
// Requires jQuery
var passes = 50, host="https://cloudwall.cloudant.com/testr/";
function go (msg, url) {
var pi = $.Deferred(),
ctr = passes,
@ermouth
ermouth / expenseReportDemo.js
Last active Sep 20, 2015
Sample expense repor widget
View expenseReportDemo.js
({
// name must be present for widgets,
// and it must be unique
name:"Expense report demo",
id:"in.ExpenseReportDemo",
// Default data
data:{
ERROR:false, // holds overall error state, true if form has errors
title:"",
You can’t perform that action at this time.