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
const listeners = [] | |
const state = {} | |
let noop = x => x | |
function subscribe (fn) { | |
listeners.push(fn) | |
} | |
function unsubscribe (fn) { | |
listeners.splice(listeners.indexOf(fn), 1) |
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
// dam | |
// https://hydra-editor-v1.glitch.me/?sketch_id=49UOxU0Jt6OzQwuc&code=YS5zZXRTY2FsZSUyMCgyMCklMEFhLnNldEJpbnMlMjAoMTUpJTBBJTJGJTJGJTBBYS5zZXR0aW5ncyU1QjAlNUQuY3V0b2ZmJTIwJTNEJTIwMSUwQWEuc2V0dGluZ3MlNUIxJTVELmN1dG9mZiUyMCUzRCUyMDIlMEFhLnNldHRpbmdzJTVCMiU1RC5jdXRvZmYlMjAlM0QlMjA0JTBBYS5zZXR0aW5ncyU1QjMlNUQuY3V0b2ZmJTIwJTNEJTIwNiUwQWEuc2V0dGluZ3MlNUI0JTVELmN1dG9mZiUyMCUzRCUyMDglMEFhLnNldHRpbmdzJTVCNSU1RC5jdXRvZmYlMjAlM0QlMjA5JTBBJTBBJTBBc2hhcGUoMykuc2NhbGUoKCklM0QlM0UlMjBhLmZmdCU1QjMlNUQqMiUyMCUyQjEpJTBBLmJsZW5kKG8wKS5hZGQoc2hhcGUoMykuY29sb3IoMCUyQzAlMkMwLjIpKSUwQS5ibGVuZChvMCkuY29sb3IoMCUyQzAuNSUyQzAuNSklMEEuYmxlbmQobzApLnJvdGF0ZSgoKSUzRCUzRSUyMGEuZmZ0JTVCMSU1RCowLjElMjAtMC4yKSUwQS5zY3JvbGxZKC0wLjUyJTJDLTAuMiklMEEuYWRkKHNoYXBlKDMpLmNvbG9yKDMlMkMwJTJDMikuc2Nyb2xsWSgoKSUzRCUzRSUyMGEuZmZ0JTVCMCU1RCowLjclMjAtMC4xJTJDLTAuMDIpKS5zY2FsZSgoKSUzRCUzRSUyMGEuZmZ0JTVCMiU1RCowLjclMjAtMC44KSUwQS5zY2FsZSgoKSUzRCUzRSUyMGEuZmZ0JTVCMyU1RCoyJTIwLTEpJTBBLm1vZHVsYXRlKG8wJTJDKCklM0QlM0UlMjBhLmZmdCU1QjMlNUQqMC4xJTIwLTAuMiklMEE |
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
let Layout = require('@architect/views/layout') | |
exports.handler = async function http (request) { | |
return { | |
type: 'text/html; charset=utf8', | |
body: Layout() | |
} | |
} |
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
module.exports = function Layout (props) { | |
props = props || {} | |
let heading = props.heading || 'Architect views!' | |
return ` | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Architect example</title> | |
</head> |
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
const state = {} | |
const listeners = [] | |
let aid | |
const handler = { | |
set: function setter (obj, prop, value) { | |
let old = obj[prop] | |
if (old !== value) { | |
obj[prop] = value | |
if (aid) { | |
window.cancelAnimationFrame(aid) |
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
var listeners = [] | |
var state = {} | |
var noop = x => x | |
function subscribe (fn) { | |
listeners.push(fn) | |
} | |
function unsubscribe (fn) { | |
listeners.splice(listeners.indexOf(fn), 1) |
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 |
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
{ | |
"base": 18, | |
"scale": { | |
"ratio": "perfectFourth", | |
"steps": 8 | |
}, | |
"colors": { | |
"primary": [ | |
{ | |
"label": "transparent", |
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
var preact = require('preact') | |
module.exports = function Component (name, obj) { | |
name = name || 'F' | |
obj = obj || {} | |
var fn = function () { preact.Component.call(this) } | |
Object.defineProperty(fn, 'name', { value: name }) | |
fn.prototype = Object.create(preact.Component.prototype) | |
fn.prototype = Object.assign(fn.prototype, obj) | |
if (obj.getDefaultProps && | |
(typeof obj.getDefaultProps === 'function')) { |
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
var html = require('bel') | |
var morph = require('nanomorph') | |
var inWindow = require('in-window') | |
var onload = require('on-load') | |
module.exports = function Component (options) { | |
options = options || {} | |
var template = options.template | |
var should = options.should || function () { return true } | |
var added = options.added |