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 * as fs from 'fs' | |
import * as path from 'path' | |
import * as globby from 'globby' | |
import { parseComponent } from 'vue-template-compiler' | |
import { format } from 'prettier' | |
import { parse } from '@babel/parser' | |
import traverse from '@babel/traverse' | |
import generate from '@babel/generator' | |
const graphqlCodeGenFile = '../src/generated/graphql.ts' |
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 NodeRSA from "node-rsa"; | |
const keyData = { | |
consumerId: "CONSUMER_ID", | |
privateKey: `-----BEGIN RSA PRIVATE KEY----- | |
MY PRIVATE KEY | |
-----END RSA PRIVATE KEY-----`, | |
keyVer: 1, | |
impactId: "YOUR IMPACT AFFILIATE ID" // not required | |
}, |
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
# Source: https://gist.github.com/fca66711eaf0440483eba42ee013311a | |
##################################### | |
# How to Apply GitOps to Everything # | |
# Combining Argo CD and Crossplane # | |
# https://youtu.be/yrj4lmScKHQ # | |
##################################### | |
# Referenced videos: | |
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4 |
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 nodeRSA = require('node-rsa'); | |
const fetch = require('node-fetch'); | |
const publicKey = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCbM2br48JS2JJy8Ajy0gy33Gu5RNAFgysUp4Mj9FqzXWg7AwdGaXc0vIAGG3vmyrP906qJpiEV1aW9GhsEGNQ9Mjmngfnu1VAKZjskVToqG1ktiXZJKSlVUfGTYj+r1lKDgd2iKt4azIzoeElk1gnLovn8zEaiCT7prHlzWWb7JgW3qp1e12e5WvSC5xX9P5iKOs6WM3qTSAX3e8qGeA9wtlHdQuDjSjWA0WlYQIFKgpoCBNZeldNxel79QgR7QKG6Oo/H4aImhDW9vXH00mGVy9QX11ngovVYPhCQWzsAo+v+Y2lAJUtFdjr2t9/mJisKxpYvpMeqVo2ZSydwBmb5' | |
const consumerId = 'change this to your consumer id' | |
const privateKey = "MIIEpAIBAAKCAQEAmzNm6+PCUtiScvAI8tIMt9xruUTQBYMrFKeDI/Ras11oOwMH\ | |
Rml3NLyABht75sqz/dOqiaYhFdWlvRobBBjUPTI5p4H57tVQCmY7JFU6KhtZLYl2\ | |
SSkpVVHxk2I/q9ZSg4HdoireGsyM6HhJZNYJy6L5/MxGogk+6ax5c1lm+yYFt6qd\ | |
XtdnuVr0gucV/T+YijrOljN6k0gF93vKhngPcLZR3ULg40o1gNFpWECBSoKaAgTW\ | |
XpXTcXpe/UIEe0ChujqPx+GiJoQ1vb1x9NJhlcvUF9dZ4KL1WD4QkFs7AKPr/mNp\ |
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
// Will only render the `content` or `render` elements if the tippy is mounted to the DOM. | |
// Replace <Tippy /> with <LazyTippy /> component and it should work the same. | |
const LazyTippy = forwardRef((props, ref) => { | |
const [mounted, setMounted] = useState(false); | |
const lazyPlugin = { | |
fn: () => ({ | |
onMount: () => setMounted(true), | |
onHidden: () => setMounted(false), |
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
// Taken mostly from prisma-labs/graphql-request | |
import "isomorphic-unfetch"; | |
import { print } from "graphql/language/printer"; | |
import { DocumentNode } from "graphql"; | |
export type Variables = { [key: string]: any }; | |
export interface Headers { | |
[key: string]: string; | |
} |
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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import { | |
ApolloClient, | |
ApolloProvider, | |
HttpLink, | |
InMemoryCache, | |
} from '@apollo/client'; |
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
overwrite: true | |
schema: "http://localhost:4000/graphql" | |
documents: src/**/*.graphql | |
generates: | |
src/generated/graphql.ts: | |
hooks: | |
afterOneFileWrite: | |
- prettier --write | |
plugins: | |
- "typescript" |
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
// server.js | |
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
const http = require('http'); | |
const https = require('https'); | |
const forceSSL = function () { | |
return function (req, res, next) { | |
if (req.headers['x-forwarded-proto'] !== 'https') { |