const csvToJson = (arr: any[]) => {
const keys = Object.keys(arr[0])
return arr.reduce(
(p, c) => `${p}\n${keys.map((k) => c[k]).join(',')}`,
keys.join(','),
)
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Quip Style Change | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Reduce bottom margin on section elements to make grouping of content more implicit. | |
// @author Andy Richardson | |
// @match https://your-quip-domain.com/* <- SWAP THIS | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=quip-apple.com | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm"> | |
<name>popos20.10</name> | |
<uuid>6c914fa3-f90a-40d0-b17d-cc24ed8ee3d8</uuid> | |
<metadata> | |
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | |
<libosinfo:os id="http://system76.com/popos/20.10"/> | |
</libosinfo:libosinfo> | |
</metadata> | |
<memory unit="KiB">4194304</memory> | |
<currentMemory unit="KiB">4194304</currentMemory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useLayoutEffect, useRef } from "react"; | |
import { createPortal } from "react-dom"; | |
const createPortalComponent = (el: HTMLElement) => ({ children }) => { | |
const ref = useRef<HTMLElement>(document.createElement("div")); | |
useLayoutEffect(() => { | |
el.appendChild(ref.current); | |
return () => el.removeChild(ref.current); | |
}, []); |
Peek.2021-07-06.11-17.mp4
PR for using cursor based pagination for fetching apps.
- Dealt with a lot of pagination methods on Urql
- Follows Relay Cursor Connections Specification
Frame times (90fps) are inconsistent causing linear movements to feel jittery/non-linear.
- Quest 2 (v28)
- Virtual Desktop: V1.20.5 (client and streamer)
- Make sure desktop is running at at least 90fps
- Visit this ufotest
Conversion of JSON to CSV without libraries
const jsonToCSV = (data, columns) => {
// Create CSV string
const makeRow = (columns) => columns.map((c) => (c === undefined ? '' : `${JSON.stringify(c)}`)).join(',') + '\n';
const resolvePath = (data, path) => path.reduce((obj, p) => obj[p], data);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wiphy phy1 | |
wiphy index: 1 | |
max # scan SSIDs: 4 | |
max scan IEs length: 2190 bytes | |
max # sched scan SSIDs: 0 | |
max # match sets: 0 | |
Retry short limit: 7 | |
Retry long limit: 4 | |
Coverage class: 0 (up to 0m) | |
Device supports AP-side u-APSD. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Event<K extends string = string, V extends any = any> = { | |
key: K; | |
value: V; | |
}; | |
export class EventTarget<T extends Event> { | |
private listeners: { [key in T["key"]]?: Array<(event: any) => void> } = {}; | |
public addEventListener<K extends T["key"]>( | |
type: K, |
NewerOlder