Skip to content

Instantly share code, notes, and snippets.

View stramel's full-sized avatar

Michael Stramel stramel

View GitHub Profile
@stramel
stramel / index.html
Created January 2, 2019 21:19 — forked from jridgewell/index.html
Text data vs nodeValue #jsbench #jsperf (http://jsbench.github.io/#b266690cc58d684e9f9eb7de3158437e) #jsbench #jsperf
<!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 December 2, 2018 19:57
Chesterish styled terminal settings for ChromeOS Pixelbook. Press Ctrl + Shift + P to access the settings. Then import this file to apply the settings.
{
"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 September 12, 2018 03:40
Abortable Fetch helper function

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 February 28, 2024 17:45
Installing Powerline fonts on Windows 10

Installing Powerline fonts on Windows 10

Steps

  1. Download and extract zip from here
  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 RemoteSigned [1]
  6. Press y then Enter to accept
@stramel
stramel / _app.js
Created May 16, 2018 23:18
Page overrides
import App, { Container } from 'next/app'
import React from 'react'
class MyApp extends App {
render() {
const {
Component, pageProps
} = this.props
return (
@stramel
stramel / server.js
Created May 16, 2018 23:12
Next.js Express Server with next-routes
const express = require('express')
const bodyParser = require('body-parser')
const next = require('next')
const cookieParser = require('cookie-parser')
const routes = require('../universal/routes')
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
const routeHandler = routes.getRequestHandler(app)
@stramel
stramel / .babelrc
Created May 11, 2018 06:14
Next.js v6 configs
{
"env": {
"development": {
"presets": ["next/babel"]
},
"production": {
"presets": ["next/babel"]
},
"test": {
"presets": [
@stramel
stramel / lazy-imports-import.html
Last active March 7, 2018 19:36
Attempt at refactor for performance gainz
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
@stramel
stramel / profiling_data.md
Last active March 7, 2018 23:27
Profiling Lazy Imports vs importHref on PSK

Profiling of lazy-imports vs importHref

Setup

System Specs

  • CPU: Intel Core i5
  • Memory: 16Gb
  • OS: Windows 10
  • Polymer CLI: 1.6.0
@stramel
stramel / polymer-upgrade-cheatsheet.md
Last active April 5, 2018 14:08
Polymer v1 to v2 Upgrade Cheatsheet with associated lint rules

Upgrade Cheatsheet

This is a simplified version of https://www.polymer-project.org/2.0/docs/upgrade. It also lists what warnings and fixes are available for each upgrade task.

Shadow DOM template and styling

DOM Template

  • <dom-module> using is or name should be replaced to use id
    • Warns
    • Fixable: Except dom-modules that contain both name and is