There are 2 libraries to load, our shipped library and the user's one.
- user/.daw/library
- installdir/library
each lib exist out:
class ProgressRing extends HTMLElement { | |
constructor() { | |
super(); | |
const stroke = this.getAttribute('stroke'); | |
const radius = this.getAttribute('radius'); | |
const normalizedRadius = radius - stroke * 2; | |
this._circumference = normalizedRadius * 2 * Math.PI; | |
this._root = this.attachShadow({mode: 'open'}); | |
this._root.innerHTML = ` |
For my own sanity ;) Scraped from a variety of places, including: http://stackoverflow.com/questions/14130560/nodejs-udp-multicast-how-to?utm_medium=twitter&utm_source=twitterfeed | |
!Server | |
var news = [ | |
"Borussia Dortmund wins German championship", | |
"Tornado warning for the Bay Area", | |
"More rain for the weekend", | |
"Android tablets take over the world", | |
"iPad2 sold out", |
export default params => { | |
const store = {}; | |
let string = ''; | |
if (params === undefined) { | |
params = {count: 6, substract: 0, width: 12, height: 3, substractHeight: 0}; | |
} | |
let {count, substract, width, height, substractHeight} = params; | |
if (count === undefined) count = 6; | |
if (substract === undefined) substract = 0; | |
if (substractHeight === undefined) substractHeight = 0; |
import define from '../../node_modules/backed/src/utils/define'; | |
import RenderMixin from '../../node_modules/custom-renderer-mixin/src/render-mixin'; | |
import './party-slider'; | |
import lines from './../utils/lines'; | |
export default define(class PartyMixer extends RenderMixin(HTMLElement) { | |
constructor() { | |
super(); | |
this.attachShadow({mode: 'open'}) | |
this._change = this._change.bind(this) |
import ipfsdNode from 'ipfsd-node'; | |
(async () => { | |
const ipfsd = await ipfsdNode({ | |
bootstrap: 'earth', | |
sharding: true, | |
relayHop: true, | |
flags: ['--enable-pubsub-experiment'], | |
repoPath: 'path/to/repo', | |
cleanup: false |
const {readFile} = require('fs'); | |
readFile('path/to/some/file', (error, buffer) => { | |
const arrayBuffer = new ArrayBuffer(buffer.length) | |
const bufferView = new Uint8Array(arrayBuffer); | |
for (var i=0, length=buffer.length; i < length; i++) { | |
bufferView[i] = buffer[i]; | |
} | |
Uni Routing
/** | |
* @export merge | |
* | |
* @param {object} object The object to merge with | |
* @param {object} source The object to merge | |
* @return {object} merge result | |
*/ | |
export const merge = (object = {}, source = {}) => { | |
// deep assign | |
for (const key of Object.keys(object)) { |