Skip to content

Instantly share code, notes, and snippets.

@d0ruk
d0ruk / DOMEventListener.js
Last active March 9, 2020 16:31
JS snippets
// unify because compliance
module.exports = {
on: function(el, eventType, func) {
if (window.addEventListener) {
el.addEventListener(eventType, func, false);
} else {
el.attachEvent("on" + eventType, func);
}
},
@d0ruk
d0ruk / radio-group.html
Created July 16, 2020 01:32 — forked from robdodson/radio-group.html
A Custom Element radio group which demonstrates roving tabindex
<!--
Copyright 2016 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and

Randomising CSS variables to change hsl(), font-size, and rotation.

Apply any one of 998 Google fonts on a text.

@d0ruk
d0ruk / keybase.md
Created April 22, 2021 20:08
proof

Keybase proof

I hereby claim:

  • I am d0ruk on github.
  • I am doruk (https://keybase.io/doruk) on keybase.
  • I have a public key ASCuOzH8ohg0nUp5sk7QDS_HZLcEExixYOhGGaGG58GnGAo

To claim this, I am signing this object:

@d0ruk
d0ruk / pipeline.mjs
Created July 20, 2022 18:27
HTTP requests pipeline
import { promisify } from "node:util";
import { pipeline as _p, Transform } from "node:stream";
import request from "got";
import { log, sleep } from "./util.mjs";
const pipeline = promisify(_p);
const transform = new Transform({
transform: function (chunk, enc, cb) {