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
name: mariadb-stack | |
services: | |
mariadb: | |
image: mariadb:11.4 | |
container_name: starter-mariadb | |
environment: | |
- MARIADB_ROOT_PASSWORD=root | |
volumes: | |
- mariadb-vol:/var/lib/mysql |
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 { useState, useEffect, useCallback, MouseEvent, TouchEvent } from 'react' | |
import * as S from './styles' | |
export default function DraggableBottomSheet({ isOpen }: { isOpen: boolean }) { | |
const [open, setIsOpen] = useState(isOpen) | |
const [isAnimating, setIsAnimating] = useState(false) // Controle da animação | |
const [isDragging, setIsDragging] = useState(false) | |
const [startY, setStartY] = useState(0) | |
const [translateY, setTranslateY] = useState(0) | |
const [shouldClose, setShouldClose] = useState(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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<style> | |
html, | |
body { |
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 { Route, Redirect } from 'react-router-dom'; | |
function App() { | |
const isAuthenticated = true; // Replace with actual authentication check | |
return ( | |
<Router> | |
<Switch> | |
<Route exact path="/" component={HomePage} /> | |
<Route exact path="/about" component={AboutPage} /> | |
<Route exact path="/contact" component={ContactPage} /> |
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
// package com.mypackage.service.orders.app.persistence; | |
// import org.springframework.beans.factory.annotation.Qualifier; | |
// import org.springframework.boot.autoconfigure.domain.EntityScan; | |
// import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties; | |
// import org.springframework.boot.jdbc.DataSourceBuilder; | |
// import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder; | |
// import org.springframework.context.annotation.Bean; | |
// import org.springframework.context.annotation.Configuration; | |
// import org.springframework.context.annotation.Primary; |
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
/** | |
* Converter for converting a string CodeValue on the DTO into a Code object with type ITEM_TYPE_CODE | |
*/ | |
Converter<String, Code> itemTypeCodeConverter = new Converter<String, Code>() { | |
public Code convert(MappingContext<String, Code> context) { | |
Code itemTypeCode = null; | |
for (Code code : ModelMapperExampleApplication.storedCodes) { | |
if (code.getCodeType().equals(ModelMapperExampleApplication.ITEM_TYPE_CODE) | |
&& code.getCodeValue().equals(context.getSource())) { | |
itemTypeCode = code; |
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
/* eslint-disable @typescript-eslint/no-var-requires */ | |
const fs = require('fs') | |
const path = require('path') | |
const generateEnvFile = config => { | |
const envContent = Object.entries(config) | |
.map(([key, value]) => `${key}=${value}`) | |
.join('\n') | |
return envContent |
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
// Implementation | |
export class UserRepository extends PrismaRepository<'user'> {} | |
import { PrismaClient } from '@prisma/client'; | |
import { PrismaService } from '../integrations/prismaService'; | |
export class PrismaRepository< | |
K extends Exclude<keyof PrismaClient, symbol | `$${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
/** | |
* Stop an iframe or HTML5 <video> from playing | |
* @param {Element} element The element that contains the video | |
*/ | |
var stopVideo = function ( element ) { | |
var iframe = element.querySelector( 'iframe'); | |
var video = element.querySelector( 'video' ); | |
if ( iframe ) { | |
var iframeSrc = iframe.src; | |
iframe.src = iframeSrc; |
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
interface RequestOptions { | |
baseUrl?: string | |
prefix?: string | |
endpoint: string | |
config?: RequestInit | |
} | |
export async function request<T, TError>({ | |
...props | |
}: RequestOptions): Promise<{ |
NewerOlder