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 express = require('express'); | |
| const next = require('next'); | |
| const port = parseInt(process.env.PORT, 10) || 3000; | |
| const env = process.env.NODE_ENV; | |
| const dev = env !== 'production'; | |
| const app = next({ | |
| dir: '.', | |
| dev | |
| }); |
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 Sequelize = require("sequelize"); | |
| const DataTypes = Sequelize.DataTypes; | |
| const setupHabit = require("./models/Habit"); | |
| // require your sequelize instance, where you called `new Sequelize()` | |
| const instance = require(""); | |
| const Habit = setupHabit(instance, DataTypes); | |
| module.exports = { Habit }; |
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 ClerkContext = createContext<Resource<Clerk>>(); | |
| const loadClerk = async () => { | |
| const clerk = new Clerk(publishableKey); | |
| await clerk.load(); | |
| return clerk; | |
| } | |
| export function ClerkProvider(props: { children: JSX.Element}) { | |
| const [clerk] = createResource(loadClerk); |
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 { ReactNode, useCallback, useEffect, useRef, useState } from "react"; | |
| import "./styles.css"; | |
| const useMouseDrag = ({ onDrag }: { onDrag: (movementX: number) => void }) => { | |
| const ref = useRef<HTMLDivElement>(null); | |
| const isPressed = useRef(false); | |
| const onStartDrag = () => { | |
| isPressed.current = true; | |
| }; |
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
| Caused by: java.lang.IndexOutOfBoundsException: fromIndex = -1 | |
| at java.base/java.lang.Thread.run(Thread.java:833) | |
| at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) | |
| at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449) | |
| at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558) | |
| at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019) | |
| at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) | |
| at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852) | |
| at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387) | |
| at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100) |
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 InputSelect = ({options, invalidate, onChange, className, muteEmpty, children, ...props}) => { | |
| useEffect(() => { | |
| if (!invalidate) { | |
| return; | |
| } | |
| if (props.value && !options.some(({value}) => value === props.value)) { | |
| onChange({ | |
| target: { | |
| type: "select", |
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, {useCallback, useEffect, useMemo, useRef, useState} from "react"; | |
| import {H_IN_MS} from "../../../../../../../common/constants/Commons"; | |
| import TimeFormat from "../../../../../../../common/components/TimeFormat/TimeFormat"; | |
| import {useSelector} from "react-redux"; | |
| import customSelector from "./customSelector"; | |
| import {Badge} from "reactstrap"; | |
| import TimeService from "../../../../../../../common/services/time/timeService"; | |
| const MARKER_HEIGHT = 16; |
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 { useEffect, useLayoutEffect, useRef, useState } from "react"; | |
| import "./styles.css"; | |
| const clamp = (number: number, min: number, max: number) => { | |
| return Math.min(Math.max(number, min), max); | |
| }; | |
| export default function App() { | |
| const [{ x, y }, setMousePosition] = useState({ x: 0, y: 0 }); | |
| const containerRef = useRef<HTMLDivElement>(null); |