Skip to content

Instantly share code, notes, and snippets.

View DogAndHerDude's full-sized avatar

Dominykas Bartkus DogAndHerDude

View GitHub Profile
import * as React from 'react';
import * as ReactDOM from 'react';
interface IProps {
clientID: string;
currency: string;
label: string;
layout: string;
shape: string;
@DogAndHerDude
DogAndHerDude / iframe_embed_height.html
Created July 5, 2019 13:11
iFrame embed with fixed height
<iframe src="https://app.calconic.com/api/embed/calculator/5d1bd4d7af0270002612d7a4" sandbox="allow-same-origin allow-forms allow-scripts allow-top-navigation allow-popups-to-escape-sandbox allow-popups" title="Calconic_ Calculator" name="Calconic_ Calculator" height="1676px" scrolling="no" style="width: 100%; border: 0; outline: none;"></iframe>
<script>
(function() {
window.addEventListener("message",function(t){
var e="https://www.paypalobjects.com/api/checkout.4.0.141.js";
if(!document.querySelector('script[src="'+e+'"]')&&t.data&&"LOAD_PAYPAL"===t.data.action){
var a=document.createElement("script");a.src=e,a.async=!0,a.dataset={paypalCheckout:!0,noBridge:!0,state:"ppxo_meta",env:"production"},document.body.append(a)
}if(t.data&&"CALCONIC_UPDATE_HEIGHT"===t.data.action){
var s=documenet.querySelector('iframe[src="https://app.calconic.com/api/embed/calculator/t.data.payload.id"]');
if(s){s.height=t.data.payload.height}}
/**
* A basic height control HOC component
* that modifies Layout Items minHeight dynamically
* Not exclusive to min height, can be height if you
* do not want to allow users to resize your component
*/
import React from 'react';
@DogAndHerDude
DogAndHerDude / template.ts
Last active April 20, 2021 07:42
Pass vars to template string
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';
const client = new ApolloClient({
cache: new InMemoryCache(),
url: 'https://staging.reneza.com/api'
});
client.query({
query: gql`