View gist:5b4ab529b2e02fb42361
1 2 3 4 5 6 7 8 9 10
function MyThing (name) {
this.name = name
}
 
MyThing.prototype.sayHello = function () {
return 'hello ' + this.name
}
 
var thing = new MyThing('Erik')
thing.sayHello()
View ablauf
1 2 3 4 5 6 7
AppView.renderSubview(starplot)
-> starplot.initialize()
-> starplot.render() (automatisch aufgerufen durch AppView.rendersubview)
-> starplot.renderWithTemplate() (aufgerufen in starplot.render())
// jetzt exisitert das HTML element starplot.el inklusive svg
-> d3.select()...
View gist:61ff0bc2fd3b81490be6
1 2 3 4 5 6 7 8 9
var context = canvas.getContext('2d')
var img = new Image()
 
img.onload = function() {
context.drawImage(img, 0, 0)
window.URL.revokeObjectURL(this.src)
}
 
img.src = window.URL.createObjectURL(new Blob([data], {'type': 'image\/jpeg'}))
View schema
1 2 3 4 5 6 7 8 9 10
/*
Products flow from one location to another. This is tracked with deliveries.
 
Delivery:
amount
sourceId
targetId
productId
*/
Delivery.belongsTo(Location, { as: 'source' })
View mixin.js
1 2 3 4 5 6 7 8 9 10
var transitionend = require('transitionend-property')
 
module.exports = {
onTransitionEnd: function(el, fn) {
var self = this
function handler(event) {
fn.call(self, event)
el.removeEventListener(event.type, handler)
}
el.addEventListener(transitionend, handler, false)
View style.css
1 2 3 4 5 6 7 8
body {
font-family: Georgia, serif;
color: #222;
line-height: 1.5;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
View index.html
1 2
<!-- in den <head> -->
<meta name="viewport" content="width=device-width, initial-scale=1">
View main.css
1 2 3 4 5 6 7 8 9 10
/* ganz ans Ende der main.css */
body {
margin: 0;
padding: 14px;
font-family: Georgia, serif;
font-size: 16px;
color: #222;
line-height:1.5;
background-color:white;
background-position: top left;
View transaction.js
1 2 3 4 5 6 7 8 9 10
{
"product": "product-id",
"from": "storage",
"to": "sold",
"volume": 10
}
// or
{
"product": "product-id",
"from": "delivery",
View gist:d287654447f2bce0b7b5
1 2 3 4 5 6
root@24e94f9f65f8:/# ls -l /usr/local/var/lib/
total 4
drwxrwxrwx 2 couchdb couchdb 4096 May 10 14:58 couchdb
root@24e94f9f65f8:/# sudo -i -u couchdb couchdb
sudo: unable to change directory to /usr/local/var/lib/couchdb: Permission denied
root@24e94f9f65f8:/#
Something went wrong with that request. Please try again.