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
@vegarringdal
vegarringdal / be cablestypes.sql
Last active December 28, 2018 18:43
sql helper
create view cable_typesBE AS
select
'Eng code(BE & engcode A,B)' as info,
ifnull(tag_cabletype, 'XX') || '-cables' as type,
sum(cast(tag_cable_length as real)) as No,
'NA' as target
from
tags
where
tag_contractor = 'BE'
@vegarringdal
vegarringdal / compose-postgres.yml
Created December 17, 2018 20:00
postgres docker and pgadmin
version: '3.5'
# docker with pgadmin/postgres/nodejs
# endable docker to start with OS
# - sudo systemctl enable docker
# to run:
# sudo docker-compose up -d
# remove the -d to get messages from docker, do not run in vscode
# todo add redis memory db for users etc
services:
postgres:
version: '3.5'
# docker with pgadmin/postgres/nodejs
# endable docker to start with OS
# - sudo systemctl enable docker
# to run:
# sudo docker-compose up -d
# remove the -d to get messages from docker, do not run in vscode
# todo add redis memory db for users etc
services:
postgres:
@vegarringdal
vegarringdal / test.sql
Created April 12, 2018 10:19
sql test
cte_drum as (
SELECT
A.PROJECT_CODE,
A.DRUNO AS DRUM_NO,
A.CTYPNO,
A.METER_MARKING_YN,
A.ON_DELIVERY,
(NVL(A.LOST,0)+ NVL(A.SCRAPPED, 0)) AS SCRAPPED_LOST,
decode (A.METER_MARKING_YN, 'Y', B.HIGH_LOW,
'N', B.INSTALLED)
<template>
<div my-settings="color:blue;height:200"></div>
<template>
<template>
<hello-world style="background-color:${randomColor(myName)}" name.bind="myName"></hello-world>
<br>
<input value.bind="myName">
<template>
<template>
<section>
<h3>${title}.html</h3>
<form>
<h4>string array</h4>
<label style="display:block">
<input type="radio" name="groupRadio" model.bind="null" checked.bind="selectedProductString"> None
</label>
<label style="display:block" repeat.for="product of productsString">
<input type="radio" name="groupRadio" model.bind="product" checked.bind="selectedProductString"> ${product}
<template>
<section class="au-animate">
<h2>Page 3</h2>
<p if.bind="special.name"><b>special.name:</b>${special.name}<br></p>
<p if.bind="special.cool[0].name"><b>special.cool[0].name:</b>${special.cool[0].name}<br></p>
<p if.bind="special.cool[0].cool[0].name"><b>special.cool[0].cool[0].name:</b>${special.cool[0].cool[0].name}<br></p>
<p if.bind="special.cool[0].cool[0].cool[0].name"><b>special.cool[0].cool[0].cool[0].name:</b>${special.cool[0].cool[0].cool[0].name}<br></p>
<p if.bind="special.cool[0].cool[0].cool[0].cool[0].name"><b>special.cool[0].cool[0].cool[0].cool[0].name:</b>${special.cool[0].cool[0].cool[0].cool[0].name}<br></p>
<p if.bind="special.cool[0].cool[0].cool[0].cool[0].cool[0]"><b>special.cool[0].cool[0].cool[0].cool[0].cool[0]:</b>${special.cool[0].cool[0].cool[0].cool[0].cool[0]}<br></p>
@vegarringdal
vegarringdal / bindingtest.ts
Created July 23, 2017 15:38
very simple test
import {Binding} from 'mf';
// todo: finish...
export class BindingTest {
// test....
public static test() {
let object: any = {
'a': 1,
'b': 2,