Skip to content

Instantly share code, notes, and snippets.

View TakayoshiKochi's full-sized avatar

Takayoshi Kochi TakayoshiKochi

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="yosin">
<span class=name>Yoshifumi</span>
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../google-map/google-map.html">
@keyframes rect {
0% { width: 20px; height: 100px; }
100% { width: 100px; height: 20px;
border-radius: 10px; }
}
div#rect {
position: absolute;
top: 20px;
left: 100px;
@TakayoshiKochi
TakayoshiKochi / functional.cc
Last active August 29, 2015 14:05
Practice C++ functor??
#include <iostream>
int add1(int x) {
return ++x;
}
int double2(int x) {
return 2 * x;
}
@TakayoshiKochi
TakayoshiKochi / focus.md
Last active June 7, 2021 14:52
document.documentElement.focus()

http://crbug.com/467043

IE11:
  (default)
  document.body.tabIndex = 0
  document.head.tabIndex = 0
  document.documentElement.tabIndex = 0
  
 document.body.focus() -&gt; work (regardless of tabIndex)
@TakayoshiKochi
TakayoshiKochi / Custom-Elements-in-Imports.md
Last active September 3, 2019 13:58
CEv1 in classic HTML Imports

Custom Elements V1 in HTML Imports

This document describes how custom elements v1 work when they are defined or used in HTML Imports.

HTML Imports is currently implemented only in Chrome, and this document provides non-normative information about Chrome's implementation in M54 and later, for the reference of future works that tries to achieve similar functionality like HTML Imports.

Defining Custom Element in an imported document

As the global context window is shared with script running in an imported document, you can access the custom elements registry via window.customElements. This is straightforward and no different from the usage in a usual HTML document.

@TakayoshiKochi
TakayoshiKochi / deep-combinator-benchmark.html
Created December 2, 2016 07:36
Benchmark for '>>>' and polyfill comparison.
<!DOCTYPE html>
<body>
<div id="root"></div>
</body>
<script>
'use strict';
if (window.testRunner) {
testRunner.dumpAsText();
}
@TakayoshiKochi
TakayoshiKochi / querySelector-benchmark.html
Created December 2, 2016 08:11
Benchmark for selectors with/without '>>>'
<!DOCTYPE html>
<body>
<div id="root"></div>
</body>
<script>
'use strict';
if (window.testRunner) {
testRunner.dumpAsText();
}
@TakayoshiKochi
TakayoshiKochi / deep-combinator-benchmark2.html
Created December 2, 2016 08:22
Benchmark for '>>>' and polyfill comparison (2)
<!DOCTYPE html>
<body>
<div id="root"></div>
</body>
<script>
'use strict';
if (window.testRunner) {
testRunner.dumpAsText();
}