Skip to content

Instantly share code, notes, and snippets.

View vegarringdal's full-sized avatar
💭
Having fun with lit-html

Vegar Ringdal vegarringdal

💭
Having fun with lit-html
View GitHub Profile
<template>
<div class="form-group">
<label for="fn">arrayObjectTest[0].name</label>
<input type="text" value.bind="arrayObjectTest[0].name" class="form-control" id="fn" placeholder="arrayObjectTest[0].name">
</div>
<div class="form-group">
<label for="ln">arrayTest[0]</label>
<input type="text" value.bind="arrayTest[0]" class="form-control" id="ln" placeholder="arrayTest[0]">
</div>
Construc: EventAggregator: []
decorators.ts:123 Construc: Router: []
decorators.ts:133 Function: Function:regElement: (2) [ƒ, "nav-bar"]
decorators.ts:123 Construc: NavBar: ["EventAggregator"]
decorators.ts:133 Function: Function:regElement: (2) [ƒ, "v-form"]
decorators.ts:123 Construc: Vform: ["EventAggregator"]
decorators.ts:133 Function: Function:regElement: (2) [ƒ, "v-form-content"]
decorators.ts:123 Construc: VformContent: ["EventAggregator"]
decorators.ts:123 Construc: ValueBind: ["EventAggregator"]
decorators.ts:123 Construc: RepeatFor: ["EventAggregator"]
adding reload plugin
page3.ts:6 Connecting to fusebox HMR at ws://127.0.0.1:4444
decorators.ts:113 Construc: EventAggregator: []
decorators.ts:113 Construc: MF: (3) ["EventAggregator", "Router", "Queue"]
decorators.ts:113 Construc: NavBar: ["EventAggregator"]
decorators.ts:113 Construc: Vform: ["EventAggregator"]
decorators.ts:113 Construc: VformContent: ["EventAggregator"]
decorators.ts:113 Construc: ValueBind: ["EventAggregator"]
decorators.ts:113 Construc: RepeatFor: ["EventAggregator"]
decorators.ts:113 Construc: MfRouter: (3) ["EventAggregator", "Router", "MF"]
@vegar ringdal <[email protected]>
export class Queue {
private tasks: any[] = [];
public add(microtask: boolean): Promise<Function> {
return new Promise((resolve) => {
if (microtask) {
this.tasks.splice(1, 0, resolve);
@vegarringdal
vegarringdal / hasAttribute.ts
Last active July 10, 2017 14:10
arrow function
// check if "x" have attribute "attr" with option to return it
const haveAttr = (x: any, attr: string, returnVal?: boolean): boolean | any => !x ? false : !x.hasOwnProperty(attr) ? false : returnVal ? x[attr] : true;
const isArray = (x: any): boolean => (!!x) && (x.constructor === Array);
const isObject = (x: any): boolean => (!!x) && (x.constructor === Object);
const isDate = (x: any): boolean => (!!x) && (x.constructor === Date);
const assert = (result, mustbe: any, name: string, check: any) =>
@vegarringdal
vegarringdal / main.cpp
Last active March 25, 2017 21:37
code odd arve test 1
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
using namespace std;
// amaazing
static const char alphanum[] =
"0123456789"
//"!@#$%^&*"
@vegarringdal
vegarringdal / typeChecker.js
Created March 3, 2017 16:45
Fusebox typechecker plugin
//to use:
// let TypeCheckPlugin = require('./typeChecker')
/*
plugins: [
fb.CSSPlugin(),
fb.HTMLPlugin({
useDefault: true
}),
fb.TypeScriptHelpers(),
fb.SourceMapPlainJsPlugin(),
<template>
<require from="valueConverters"></require>
<require from="v-grid-control-form.html"></require>
<div class="row">
<v-grid
class="col-md-6"
style="height:350px"
v-row-height="25"
v-header-height="50"
v-multi-select="true"
@vegarringdal
vegarringdal / app.html
Last active April 7, 2017 08:49 — forked from jdanyow/app.html
Aurelia Gist
<template>
<div repeat.for="x of messages">
<div column=${$index} >${$index}</div>
</div>
</template>
@vegarringdal
vegarringdal / app.html
Created November 29, 2016 15:58 — forked from Thanood/app.html
Aurelia-Materialize bridge select in modal
<template>
<div>
<div>
<p><a md-button href="#modal1">show modal (href with ID)</a></p>
</div>
<div id="modal1" md-modal md-modal.ref="modal" style="overflow:visible">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
<p>A bunch of text</p>