Skip to content

Instantly share code, notes, and snippets.

View phlickey's full-sized avatar
🤖

Philip Hickey phlickey

🤖
View GitHub Profile
const getArray = (size) =>
Array(size)
.fill(null)
.map((_, idx) => ({
id: `element-${idx}`,
value: Math.floor(Math.random() * 100),
}));
const totals = [];
@phlickey
phlickey / index.html
Created February 22, 2025 14:46
React with 0 dependencies
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script
const Modal: React.FC<{
renderContent: (props: { close: () => void }) => React.ReactNode;
renderHandle: (props: { open: () => void }) => React.ReactNode;
}> = ({ renderContent, renderHandle }) => {
const ref = useRef<HTMLDialogElement>(null);
const open = () => ref.current?.showModal();
const close = () => ref.current?.close();
return (
<>
const isOdious = num => ((num >>> 0).toString(2).split('').reduce((count, cur)=> count += parseInt(cur), 0) % 2) !== 0

Keybase proof

I hereby claim:

  • I am phlickey on github.
  • I am phlickey (https://keybase.io/phlickey) on keybase.
  • I have a public key ASBvvgVED_DMlCZLstKOTFyiwJCPsy2OPoTZ2bNHy8D21Ao

To claim this, I am signing this object:

@phlickey
phlickey / flowchart-external-state-example.jsx
Last active July 31, 2019 18:33
An example of using state with hooks to show a little more clearly how external state works in @mrblenny/react-flow-chart
import {FlowChart} from "@mrblenny/react-flow-chart";
import React, {useState, useEffect} from "react";
import * as actions from "@mrblenny/react-flow-chart/src/container/actions";
export default function ChatEditor(){
let [chart, updateChart] = useState({
offset:{
x: 0,
y: 0
},
nodes : {
Verifying my Blockstack ID is secured with the address 1FYFx4WieU43DgBQXacf22AQkobyUexRwH https://explorer.blockstack.org/address/1FYFx4WieU43DgBQXacf22AQkobyUexRwH