This file contains hidden or 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
const Section = ({ icon, title, content, onClickTitle }) => ... | |
const accordionContext = React.createContext(); | |
const Accordion = ({ children }) => { | |
const [openSections, setOpenSection] = useState([]); | |
return ( | |
<div> | |
{children} |
This file contains hidden or 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
const Form = ({ onSubmit, ...props }) => { | |
const formBag = useForm(props); | |
return ( | |
<form onSubmit={formContext.handleSubmit(onSubmit)}> | |
<FormProvider value={formBag}>{children}</FormProvider> | |
</form> | |
); | |
}; |
This file contains hidden or 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 GH_PAGER=cat # this is important to keep gh from using less as a pager | |
export GH_REPO="<org-name>/<repo-name>" # for instance, shipengine/shipengine-elements | |
export GH_WORKFLOW_FILENAME="<workflow-filename>" # for instance, "lint-and-test.yml" | |
gh api repos/$GH_REPO/actions/workflows/$GH_WORKFLOW_FILENAME/runs --paginate --jq '.workflow_runs[] | .id' | \ | |
xargs -n 1 -I % gh api repos/$GH_REPO/actions/runs/% -X DELETE |
This file contains hidden or 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
router.get("/orders/:id", (req, res) => { | |
const { sourceCode } = req.query; | |
try { | |
const order = await getOrderById(req.params.id); | |
res.status(200).json(order); | |
} catch (err) { | |
if (axios.isAxiosError(err)) { | |
if (err.code === 404 && sourceCode) { | |
await refreshOrderSource(sourceCode); |
This file contains hidden or 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
interface ButtonProps { | |
children: React.ReactNode; | |
disabled: boolean; | |
loading: boolean; | |
onClick: () => void; | |
variant?: keyof variants; | |
} | |
const variants = { | |
primary: { |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am andyhite on github. | |
* I am andyhite85 (https://keybase.io/andyhite85) on keybase. | |
* I have a public key ASD7eF8JaayxoojCLdVDJKYbekmxJsMxj5u9KzNTBQTmvgo | |
To claim this, I am signing this object: |
This file contains hidden or 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
const DOCUMENT_FORMS = { | |
"pay_application": PayApplicationForm, | |
"invoice": InvoiceForm, | |
... | |
} | |
const DocumentViewer = (props) => { | |
const { document } = props; | |
const DocumentForm = DOCUMENT_FORMS[document.type]; |
This file contains hidden or 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
# Is this preferable... | |
defmodule Invoice do | |
... | |
def execute(%Invoice{id: invoice_id} = invoice, %AddLineItem{} = add) do | |
# Generate %LineItemAdded and %InvoiceTotalUpdated using Commanded.Aggregate.Multi | |
# The %InvoiceTotalUpdated event would have the new total on it, calculated based on the | |
# existing invoice total + the new line item's total | |
end |
This file contains hidden or 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
0x03f2f0bd08F4918f4c64E5b3D2395c0b819f0219 |
This file contains hidden or 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 React, { Component, PropTypes } from 'react'; | |
import { getStyles } from '../../styles'; | |
import { keypath } from '../../utils'; | |
import CheckBoxInput from '../CheckBoxInput'; | |
import Icon from '../Icon'; | |
const renderValueAtKeypath = (row, { key, renderer }) => { | |
let value = key ? keypath.get(row, key) : row; | |
if (renderer) value = renderer.call(null, value, row); |
NewerOlder