Skip to content

Instantly share code, notes, and snippets.

View romgrk's full-sized avatar
♥️
hey

Rom Grk romgrk

♥️
hey
View GitHub Profile
function wrapSx(Component) {
const newComponent = (props) => {
const { sx, ...rest } = props
rest.className = useSx(sx)
return Component(rest)
}
newComponent.displayName = Component.displayName ?? Component.name
return newComponent
import {
Box,
Paper,
Container,
} from '@mui/material'
import sx from '@mui/system/styleFunctionSx'
function Row() {
return (
<div>
@romgrk
romgrk / Slow.jsx
Created October 30, 2024 05:36
Simulated slow react component
const WAIT_DURATION = 2
function Slow() {
const start = Date.now()
while ((Date.now() - start) < WAIT_DURATION) {}
return (
<span>slow</span>
)
}
4375 Noah Lemen (2%) [META]
7122 Jack Pope (3%) [META]
14077 Jan Kassens (6%) [META]
15291 Sebastian Silbermann (7%) [VERCEL]
24125 Rick Hanlon (10%) [META]
25050 Ruslan Lesiutin (11%) [META]
25240 Andrew Clark (11%) [VERCEL]
41302 Josh Story (18%) [VERCEL]
58361 Sebastian Markbåge (25%) [VERCEL]
@romgrk
romgrk / gist:2c7f97363b1f5d580857bd560c7c1dfc
Created September 19, 2024 22:42
rg 'theme\.' $(fd . packages/x-data-grid*)
packages/x-data-grid-pro/src/hooks/features/columnReorder/useGridColumnReorder.tsx: (theme.direction === 'rtl'
packages/x-data-grid-pro/src/hooks/features/columnReorder/useGridColumnReorder.tsx: (theme.direction === 'rtl'
packages/x-data-grid-pro/src/hooks/features/columnReorder/useGridColumnReorder.tsx: [apiRef, logger, theme.direction],
packages/x-data-grid-pro/src/components/GridColumnMenuPinningItem.tsx: if (theme.direction === 'rtl') {
packages/x-data-grid-premium/src/components/GridGroupingColumnFooterCell.tsx: `calc(var(--DataGrid-cellOffsetMultiplier) * ${theme.spacing(props.rowNode.depth)})`;
packages/x-data-grid-pro/src/components/GridDetailPanel.tsx: backgroundColor: (theme.vars || theme).palette.background.default,
packages/x-data-grid-premium/src/components/GridAggregationHeader.tsx: fontSize: theme.typography.caption.fontSize,
packages/x-data-grid-premium/src/components/GridAggregationHeader.tsx: lineHeight: theme.typography.caption.fontSize,
packages/x-data-gri
@romgrk
romgrk / potato
Created September 12, 2024 23:37
f0VMRgIBAQAAAAAAAAAAAAIA8wABAAAAABAQAAAAAABAAAAAAAAAAJgxAAAAAAAAAAAAAEAAOAAE
AEAACAAGAAEAAAAEAAAAABAAAAAAAAAAABAAAAAAAAAAEAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQ
AAAAAAAAAQAAAAcAAAAAIAAAAAAAAAAQEAAAAAAAABAQAAAAAAB0AAAAAAAAAHQAAAAAAAAAABAA
AAAAAABR5XRkBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAMAAHAEAAAAByEAAAAAAAAAAAAAAAAAAAAAAAAAAAAALwAAAAAAAAAvAAAAAAAAAAEAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
const encoder = new TextEncoder()
// bufferLength must be a multiple of 4 to satisfy Int32Array constraints
let bufferLength = 2 * 1024
let buffer = new ArrayBuffer(bufferLength)
let uint8View = new Uint8Array(buffer)
let int32View = new Int32Array(buffer)
export function murmur2(str) {
if (str.length > bufferLength) {
import * as React from 'react';
import { flushSync } from 'react-dom';
import {
Button,
Container,
Checkbox,
Switch,
Box,
Paper,
TextField,
// See 2nd file in this gist for strings dataset
import b from 'benny';
import MurmurWasm from '/home/romgrk/src/emotion/packages/hash-rust/index'
import strings from './emotionStrings'
const inputs = [
'background-color:red;',
'background-color:red;color:white;border-radius:24px;font-size:12px;font-family:"Roboto";',
import * as React from 'react';
import { flushSync } from 'react-dom';
import {
Button,
Container,
Checkbox,
Switch,
Box,
Paper,
TextField,