This file contains 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 fs from 'fs'; | |
import * as path from 'path'; | |
import { AxiosResponse } from 'axios'; | |
import dotenv from 'dotenv'; | |
import { Configuration, CreateChatCompletionResponse, OpenAIApi } from 'openai'; | |
// configure dotenv | |
dotenv.config(); |
This file contains 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'; | |
// Define a type alias for the days of the week | |
type Days = { | |
monday: string; | |
tuesday: string; | |
wednesday: string; | |
thursday: string; | |
friday: string; |
This file contains 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
// Typescript | |
const slugify = (str: string) => { | |
// remove accents, swap ñ for n, etc | |
const from = 'àáãäâèéëêìíïîòóöôùúüûñç·/_,:;'; | |
const to = 'aaaaaeeeeiiiioooouuuunc------'; | |
const slug = str.split('').map((letter, i) => { | |
return letter.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
}); |
This file contains 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
<template> | |
<div> | |
<div class="prose prose-lg"> | |
<prismic-rich-text :field="page.content" /> | |
</div> | |
</div> | |
</template> | |
<script> | |
export default { |
This file contains 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
/** | |
* To learn more about Link Resolving check out the Prismic documentation | |
* https://prismic.io/docs/vuejs/beyond-the-api/link-resolving | |
*/ | |
export default function(doc) { | |
if (doc.isBroken) { | |
return '/not-found' | |
} |
This file contains 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
{ | |
buildModules: [ | |
'@nuxtjs/prismic' | |
], | |
prismic: { | |
endpoint: 'https://<REPOSITORY>.cdn.prismic.io/api/v2', | |
modern: true | |
/* see configuration for more */ | |
} | |
} |
This file contains 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 React from "react"; | |
import { useMousePosition } from "~/hooks/useMousePosition"; | |
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
const [mouseX, mouseY] = useMousePosition(); | |
const positions = { x, y, h, w, mouseX, mouseY }; | |
return ( | |
<div |
This file contains 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
<template> | |
<div id="map" class="mt-4 sm:mt-8 sm:mx-5 sm:mb-5"></div> | |
</template> | |
<script> | |
export default { | |
name: 'DepotsMap', | |
data() { | |
return { | |
selectedMarker: null, |
This file contains 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
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off; | |
server { | |
listen 443 ssl http2 default_server; | |
listen [::]:443 ssl http2 default_server; | |
server_name example.com; | |
location /api/ { | |
# Rate Limiting | |
limit_req zone=reqlimit burst=20; # Max burst of request |
This file contains 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
https://www.cassie.codes/ | |
.css-19gwvxx { | |
color: var(--theme-ui-colors-mutedText,#DFE5F3); | |
-webkit-text-decoration: none; | |
text-decoration: none; | |
border-bottom-width: 2px; | |
border-bottom-style: solid; | |
border-bottom-color: var(--theme-ui-colors-mutedPrimary,rgb(176,251,188)); | |
--underlineWidth: 2px; |
NewerOlder