Proposal for the Strawberry Relay API.
from strawberry import relay
@strawberry.type
<iframe style="width: 100%;" id="fronted-payments-container" src="https://app.fronted.rent/embed/v1/widget?partnerId=..." scrolling="no" /> | |
<script> | |
(function() { | |
var frame = document.getElementById("fronted-payments-container"); | |
frame.addEventListener("load", function() { | |
frame.contentWindow.postMessage("measure-height", "https://app.fronted.rent"); | |
}); | |
window.addEventListener("message", function(event) { | |
if (event.origin !== "https://app.fronted.rent") return; | |
var data = JSON.parse(event.data); |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
if [ -z "$1" ]; then | |
echo "Diff or diff range not provided" | |
exit 1 | |
fi | |
diff_range=$1 | |
shift |
import logging | |
from typing import Optional, Literal, List, cast | |
from graphql import DocumentNode as GraphQLDocumentNode | |
from graphql.language import OperationDefinitionNode, DefinitionNode | |
from strawberry.extensions import Extension | |
def get_first_operation( |
import logging | |
from typing import Optional, Literal, List, cast | |
import sentry_sdk | |
from graphql import DocumentNode as GraphQLDocumentNode | |
from graphql.language import OperationDefinitionNode, DefinitionNode | |
from strawberry.extensions import Extension | |
logger = logging.getLogger(__name__) |
from textwrap import dedent | |
from typing import Any, Awaitable, Dict, Type, Union, cast, List | |
import strawberry | |
from strawberry.field import StrawberryField | |
from strawberry.arguments import StrawberryArgument, UNSET | |
from strawberry.types.generics import get_name_from_types | |
def test_simple_custom_field(): |
Here is the code for a hook that wraps the useState
hook and persistes the value in a cookie. There are lots of other implementations of a similar hook (e.g. https://dev.to/selbekk/persisting-your-react-state-in-9-lines-of-code-9go) but they don't work with Next.js because localstorage
is not available on the server.
import React from "react";
import usePersistedState from "./usePersistedState";
I hereby claim:
To claim this, I am signing this object:
import React from 'react'; | |
import { Motion, spring, presets } from 'react-motion'; | |
import { findDOMNode } from 'react-dom'; | |
import styled from 'styled-components'; | |
import { pure } from 'recompose'; | |
// import Swipeable from 'depop/utils/Swipeable'; | |
const CarouselContainer = styled.ul` |