This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function InputText({ html, state, utils={} }) { | |
const { attrs={} } = state | |
const { | |
description='', | |
label='', | |
name='', | |
pattern='', | |
placeholder='', | |
value='', | |
min='', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class CustomElement extends HTMLElement { | |
constructor() { | |
super() | |
const templateName = `${this.tagName.toLowerCase()}-template` | |
const template = document.getElementById(templateName) | |
if (template) { | |
this.template = template | |
} | |
else { | |
this.template = document.createElement('template') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class ElementBase extends HTMLElement { | |
constructor() { | |
super() | |
const name = this.tagName.toLowerCase() | |
const template = document.getElementById(`${name}-template`) | |
if (template) { | |
this.replaceChildren(template.content.cloneNode(true)) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { exec } from "https://deno.land/x/exec/mod.ts"; | |
const watcher = Deno.watchFs("./"); | |
for await (const event of watcher) { | |
// if you're curious | |
// let kind = event.kind | |
// console.log('EVENT KIND: ', kind) | |
await exec('clear') | |
await exec('deno test --allow-read') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<template id="a"> | |
<style> | |
slot { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Fixed header</title> | |
<style> | |
.container { | |
display: flex; | |
flex-direction: column; | |
position: absolute; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function name would be the page name | |
export async function Main(html, data) { | |
return html`<my-custom-element todos="${data.todos}"></my-custom-element>` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<template id=my-paragraph-template> | |
<p> | |
<slot name="my-text"> | |
My default text | |
</slot> | |
</p> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<template id=begin-page-template> | |
<h1>Begin Page</h1> | |
<begin-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
#test on python 3.4 ,python of lower version has different module organization. | |
import http.server | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
import socketserver | |
PORT = 8080 | |
Handler = http.server.SimpleHTTPRequestHandler |