Skip to content

Instantly share code, notes, and snippets.

View phlickey's full-sized avatar
🤖

Philip Hickey phlickey

🤖
View GitHub Profile
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