Skip to content

Instantly share code, notes, and snippets.

View seanconnelly34's full-sized avatar

seanconnelly34

View GitHub Profile
/**This script gets injected into the stencil template iframes on the edit page and
* is not processed as part of the app webpack build. This is why the file is self
* contained and does not use any imports. Due to the way create-react-app locks down
* the webpack settings, we were not able to modularize this file.
*/
const domLoaded = () => {
// variables
const __parentWindow = window.parent;
const __parentOrigin = window.origin;
const editableElements = document.querySelectorAll('[contenteditable]:not(.custom)');
@seanconnelly34
seanconnelly34 / Canvas2.js
Created May 27, 2024 17:26
Canvas Row Drag and Drop Form Elements
import React from 'react';
import { v4 as uuid } from 'uuid';
import styled from 'styled-components';
import CanvasRow from '@/components/dashboard/canvas/CanvasRow';
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { DRAGGABLE_FORM_ELEMENTS } from '../../utils';
import { useDispatch, useSelector } from '@/hooks/useRedux';
import { setFormElements } from '@/store/formElementsSlice';
@seanconnelly34
seanconnelly34 / Sum.tsx
Created October 4, 2022 17:18
Sum component that retruns sum, and toggles display or sum with radio buttons
import React, { useState, useMemo } from "react";
interface ISumProps {
values: number[];
}
const Sum = ({ values }: ISumProps) => {
const [showSum, setShowSum] = useState<boolean>(false);
const sum = useMemo(
require("dotenv").config();
const path = require("path");
const express = require("express");
const fs = require("fs");
const app = express();
const cors = require("cors");
//encrypt pdf
const buildPath = path.join(__dirname, "..", "build");
app.use(express.json());
require("dotenv").config();
const path = require("path");
const express = require("express");
const fs = require("fs");
const app = express();
const cors = require("cors");
//encrypt pdf
const buildPath = path.join(__dirname, "..", "build");
app.use(express.json());
const path = require("path");
const express = require("express");
const fs = require("fs");
const app = express();
const cors = require("cors");
const buildPath = path.join(__dirname, "..", "build");
app.use(express.json());
app.use(express.static(buildPath));
import NewDate from "../../utils/NewDate";
export default {
date: NewDate(),
name: "",
dob: "",
age: "",
healthcard: "",
effectivedate: "",
expirydate: "",
import React, { useState } from "react";
import SignatureCanvas from "react-signature-canvas";
import { Button, Grid, Container } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
import axios from "axios";
import State from "./state.js";
import PersonalInfo from "./components/PersonalInfo";
import MedicalHistory from "./components/MedicalHistory";
import MedicalHistory2 from "./components/MedicalHistory2";
import Allergies from "./components/Allergies";
import React, { useState } from "react";
import { Formik, Field, Form, ErrorMessage } from "formik";
import * as Yup from "yup";
const Registration = () => {
const [state, setState] = useState({ fullName: "", email: "" });
// const sendEmail = (e) => {
// e.preventDefault();
// console.log("sending emails");
const express = require("express");
require("./db/mongoose");
const User = require("./models/user");
const Task = require("./models/task");
const app = express();
//heroku deployment port, otherwise locally use 3000
const port = process.env.PORT || 3000;