let text = `
あいう
えお
かきくけこ
`.trim()
console.log(text)
This file contains hidden or 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 const createLogger = (id, parent) => { | |
const listeners = parent?.listeners || {} | |
const logger = {} | |
const on = (type, fn) => { | |
if (!listeners[type]) { | |
listeners[type] = new Set() | |
} | |
listeners[type].add(fn) | |
} |
This file contains hidden or 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> | |
<meta charset="utf-8" /> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
body { | |
height: 100vh; |
This file contains hidden or 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 lcsvp = (cols, opt) => { | |
const cols_def = cols.map((c) => (typeof c === "boolean" ? { quote: c } : c)) | |
const cols_restr = cols_def.map((c) => (c.quote ? `"((?:[^"]|"")*?)"` : "([^,]*?)")).join(opt?.space ? " *, *" : ",") | |
const row_re = new RegExp(`^${cols_restr}(?:\r?\n|$)`) | |
const cols_formatter = cols_def.map((x) => (x.type === JSON ? JSON.parse : x.type || String)) | |
const unescape = (str, ci) => (cols_def[ci].quote ? str.replace(/""/g, '"') : str) | |
return (text) => { | |
const rows = [] | |
while (text) { |
This file contains hidden or 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
<?php | |
function get_namespace_items($namespace, $include_sub_namespaces = false) { | |
$namespace = trim($namespace, '\\') . '\\'; | |
$classes = get_declared_classes(); | |
$interfaces = get_declared_interfaces(); | |
$traits = get_declared_traits(); | |
$functions = get_defined_functions(); | |
$constants = get_defined_constants(); |
This file contains hidden or 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
class Base extends HTMLElement { | |
constructor() { | |
super() | |
const root = this.attachShadow({ mode: "open" }) | |
root.context = {} | |
for (const name of this.bind_properties) { | |
Object.defineProperty(this, name, { | |
get() { | |
const attr = this.getAttribute(name) |
This file contains hidden or 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> | |
<meta charset="UTF-8"> | |
<title>poffice map</title> | |
<style> | |
positions-map { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; |
This file contains hidden or 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> | |
<meta charset="utf-8" /> | |
<title>enex preview and convert</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
} | |
body { |
This file contains hidden or 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> | |
<style> | |
.cvs { | |
background: #eee; | |
width: 500px; | |
height: 100px; | |
margin: 30px auto; | |
display: flex; | |
perspective: 400px; |