Skip to content

Instantly share code, notes, and snippets.

@ermouth
ermouth / ToDo.js
Created September 7, 2015 16:00
Sample plugin manifest for Inliner
{
"id": "in.ToDo",
name:"Todo list",
"data": {
"cmd": "",
"filter": ["All"],
"editor": {
"_id": "",
"name": "",
"type": "todo",
@ermouth
ermouth / manloader.js
Last active September 3, 2015 06:45
External manifest loader
({
require:[
{
"this.App":{
url:"http://your.domain/someExternalManifest.json",
dataType:"json",
cache:false
}
}
],
@ermouth
ermouth / rewrites.js
Last active September 4, 2015 18:21
Rewrites for Inliner
([
// Root
{from:"/:db/_inliner", to:"../../../:db/_design/inliner27/index.html"},
// Resources
{from:"/:db/js/*", to:"../../../:db/_design/inliner27/js/*"},
{from:"/:db/css/*", to:"../../../:db/_design/inliner27/css/*"},
{from:"/:db/i/*", to:"../../../:db/_design/inliner27/i/*"},
{from:"/:db/inliner-templates.json", to:"../../../:db/_design/inliner27/inliner-templates.json"},
{from:"/:db/inliner-widgets.json", to:"../../../:db/_design/inliner27/inliner-widgets.json"},
@ermouth
ermouth / gist:53692ee474abc3b301fc
Last active August 29, 2015 14:23
$.my Master-detail
({
"params": {
"delay": 30,
"recalcDepth": 1
},
"require": [{
// You may need to insert you own data source since CORS limitations could apply
"this.List": "http://s3-eu-west-1.amazonaws.com/ermouth/rockstar-deaths.json"
}],
"data": {
@ermouth
ermouth / gist:61cab64ffc7cb5578238
Created May 16, 2015 10:11
Polish notation expression eval
var polish = (function () {
var ops = ['*','/','+','-']
.reduce( function(a, b){
a[b] = Function ( 'x', 'return x[0]=x.shift()' + b + 'x[0], x' );
return a;
}, {});
Object.getOwnPropertyNames(Math)
.forEach( function(b){
var l = Math[b].length, f = '';
if (l === void 0) f = 'x.unshift(Math.' + b + '), x';