Skip to content

Instantly share code, notes, and snippets.

Michael Stramel stramel

Block or report user

Report or block stramel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stramel
stramel / object-from-path.js
Created Jun 13, 2019
Playing around with creating an object from a path string for react-hook-form
View object-from-path.js
const values = {
'property': 'foo',
'categories[1]': 'action',
'categories[0]': 'adventure',
'debug.works': 'true',
'person[0].active': 'true',
'person[0].name.first': 'testFirst',
'person[0].name.last': 'testLast',
'person[0].numbers[0]': '1234',
'person[0].numbers[1]': '5678',
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@stramel
stramel / shady-style.js
Last active Feb 15, 2019
[WIP] ShadyStyle
View shady-style.js
import "@webcomponents/shadycss/custom-style-interface.min.js";
const { CustomStyleInterface } = window.ShadyCSS;
class ShadyStyle extends HTMLElement {
__style = null;
constructor() {
super();
@stramel
stramel / intersectionObserver.js
Last active Mar 18, 2019
[WIP] IntersectionObserver element
View intersectionObserver.js
class MyIntersectionObserver extends HTMLElement {
constructor() {
super();
this._observer = null;
this._visited = false;
this._root = null;
this._rootMargin = '0px';
this._threshold = 0;
this._shadowRoot = this.attachShadow({ mode: 'open' });
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>for-of loop vs forEach</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@stramel
stramel / Features.md
Last active Feb 12, 2019
(WIP) Ideal Image (Maybe Video) Component
View Features.md

Ideal Image Component

Features

@stramel
stramel / index.html
Created Jan 2, 2019 — forked from jridgewell/index.html
Text data vs nodeValue #jsbench #jsperf (http://jsbench.github.io/#b266690cc58d684e9f9eb7de3158437e) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Text data vs nodeValue #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@stramel
stramel / Chesterish-terminal.json
Last active Dec 2, 2018
Chesterish styled terminal settings for ChromeOS Pixelbook. Press Ctrl + Shift + P to access the settings. Then import this file to apply the settings.
View Chesterish-terminal.json
{
"magic": "nassh-prefs",
"version": 1,
"nassh": { "profile-ids": [] },
"hterm": {
"chesterish": {
"background-color": "rgba(41, 51, 64, 1)",
"cursor-blink": true,
"cursor-color": "rgba(44, 133, 247, 0.5)",
"font-family": "\"Fira Code\", \"DejaVu Sans Mono\", \"Noto Sans Mono\", \"Everson Mono\", FreeMono, Menlo, Terminal, monospace",
@stramel
stramel / README.md
Created Sep 12, 2018
Abortable Fetch helper function
View README.md

Abortable Fetch helper

Usage

import fetch, { ABORT_ERROR } from 'custom-fetch'

const abortableFetch = makeAbortable(fetch) // Defaults to `window.fetch` if no fetch is passed

const request = abortableFetch('/URL') // Returns an object with a `promise` and an `abort` property
@stramel
stramel / HOWTO.md
Last active Jun 30, 2018
Installing Powerline fonts on Windows 10
View HOWTO.md

Installing Powerline fonts on Windows 10

Steps

  1. Download and extract zip from https://github.com/powerline/fonts
  2. Press Windows + x
  3. Press a (Selects PowerShell (Admin)
  4. Navigate to directory where fonts were extracted to (cd ${HOME}\Downloads\fonts-master\fonts-master)
  5. Set Execution policy Set-ExecutionPolicy Bypass
  6. Press y then Enter to accept
You can’t perform that action at this time.