Skip to content

Instantly share code, notes, and snippets.

@agektmr
agektmr / WebAuthn_JSON_serialization_polyfill.js
Last active September 3, 2024 08:39
WebAuthn JSON serialization polyfill
class base64url {
static encode(buffer) {
const base64 = window.btoa(String.fromCharCode(...new Uint8Array(buffer)));
return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
}
static decode(base64url) {
const base64 = base64url.replace(/-/g, '+').replace(/_/g, '/');
const binStr = window.atob(base64);
const bin = new Uint8Array(binStr.length);
@agektmr
agektmr / one-time-code.md
Last active September 11, 2020 09:58
`input[autocomplete="one-time-code"]` polyfill using Web OTP API
if ('customElements' in window && 'OTPCredential' in window) {
  customElements.define("web-otp",
    class extends HTMLInputElement {
      connectedCallback() {
        this.abortController = new AbortController();
        this.receive(); 
      }
      disconnectedCallback() {
 this.abort();
API/payment method Chrome Edge Safari Samsung Internet Firefox
@agektmr
agektmr / karabinar_JIS_ASCII.json
Created August 19, 2017 14:09
Converts JIS keyboard layout to ASCII keyboard layout in Karabinar Elements
{
"title": "For Japanese (JIS配列をASCII配列風にする設定)",
"rules": [
{
"description": "英数・かなキーを他のキーと組み合わせて押したときに、コマンドキーを送信する。",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "japanese_eisuu",

Keybase proof

I hereby claim:

  • I am agektmr on github.
  • I am agektmr (https://keybase.io/agektmr) on keybase.
  • I have a public key ASA18VYrnHxJ0JjmiW3VhGzGrQPzg7V1DnYvG07Mwk4xHwo

To claim this, I am signing this object:

@agektmr
agektmr / Installing Project Tab Manager beta.md
Last active February 3, 2016 01:40
How to install Project Tab Manager beta
  1. Download a zip file from here
  2. Open chrome://extensions on Chrome
  3. Check "Developer Mode"
  4. Click "Load unpacked extension..." and select the unzipped folder

Questions are welcome at https://twitter.com/agektmr

@agektmr
agektmr / Twitter Like
Last active November 6, 2015 14:56
Copy and paste this code to your browser URL bar. (URLバーにコピペしてね)
data:text/html,<script>i=0;setInterval(function(){i=(i+100)%252000;document.querySelector('div').style.backgroundPositionX='-'+i+'px';},30);</script><div%20style="width:100px;height:100px;background:url(https://goo.gl/6nq9n5)">
@agektmr
agektmr / list_of_web_music_hackathons.md
Last active August 29, 2015 14:21
List of Web Music Hackathons
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;