Skip to content

Instantly share code, notes, and snippets.

Windows 10/11 Registry Edits

Hardware acceleration

  1. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers
  2. Under the "GraphicsDrivers" key create a new DWORD (32-bit) value named "HwSchMode"
  3. Set the Hexadecimal value to 2
  4. Restart PC

Large Taskbar

  1. Navigate to Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
@whaaaley
whaaaley / vscode-settings.json
Last active February 26, 2021 03:59
Incredibly long list of settings to make VSCode usable 2021
{
"breadcrumbs.enabled": false,
"editor.cursorBlinking": "phase",
"editor.folding": false,
"editor.fontFamily": "SF Mono",
"editor.fontSize": 13,
"editor.fontWeight": 300,
// "editor.formatOnSave": true,
// "editor.hover.enabled": false,

You probably don't need a JWT library 2020

It's 2020. You have an idea for new webapp. The scope is small, but requires auth. You look at services like Auth0 and libraries like node-jsonwebtoken. You've probably read about the countless security bugs they've had.

It's 2020 they should have it figured out

The npm package node-jsonwebtoken is a huge library where most of the core functionality comes from a dependency of a dependency, node-jws which depends on node-jwa of the same author, and both of them are no longer maintained. If you look at the Github issues of node-jws, you can find a thread explaining how the maintainers don't have time to work on the projects anymore and reccomend using a newer project, Github user Panva's jose.

So just use jose

<html>
<head>
<script>
(() => {
const voidTags = ['area', 'base', 'br', 'circle', 'col', 'ellipse',
'embed', 'img', 'input', 'line', 'link', 'mesh', 'meta', 'param',
'path','polygon','polyline','rect','source','track','wbr']
const h = (tag, data, children) => {
let attrs = ''

You don't need CORS Middleware 2019

A node example using Zeit's Micro.

const micro = require('micro')

const server = micro(async (request, response) => {
 // set response headers

WebApp Rendering Strategies 2019

Client Side Rendering

Tooling: Hyperapp, Mithril, React, Vue

Pros

  • Dynamic Routing. There's no refresh when routing between pages.

Cons

  • JavaScript must be downloaded before the page can begin to render, slowing down first paint performance.[1]
diskutil eraseDisk FAT32 "WINDOWS10" MBRFormat disk2
sudo newfs_msdos -F 32 -c 16 disk2
cp -rp /Volumes/CCCOMA_X64FRE_EN-US_DV9/* /Volumes/WINDOWS10/
window.fetch('sunset.jpg')
.then(res => {
const reader = res.body.getReader()
let result = new Uint8Array()
const processImage = ({ done, value }) => {
if (done) {
console.log('done')