Skip to content

Instantly share code, notes, and snippets.

View devbyray's full-sized avatar
:octocat:
Building cool things!

Dev By Ray devbyray

:octocat:
Building cool things!
View GitHub Profile
@devbyray
devbyray / docReady-promise.ts
Created December 13, 2023 07:57
Document Ready with a Promise in TypeScript
View docReady-promise.ts
export function docReady(): Promise<void> {
return new Promise((resolve) => {
if (document.readyState === 'interactive') {
resolve()
} else {
window.addEventListener('DOMContentLoaded', () => {
resolve()
})
}
})
@devbyray
devbyray / pull_request_template.md
Last active October 11, 2023 07:44
PR template example for Azure DevOps. Put this file in the folder ".azuredevops".
View pull_request_template.md
  • The pull request title and description are clear and concise, and follow the project’s pull request template.
  • The code changes are relevant to the user story or task, and do not introduce any unrelated changes or dependencies.
  • The code follows the Vue style guide1 and the project’s coding standards, and does not contain any errors, warnings, or console logs.
  • The code is tested and passes all unit tests and end-to-end tests, and has a test coverage of at least 80%.
  • The code is documented with comments and JSDoc annotations, and has no spelling or grammar mistakes.
  • The code is linted and formatted with Prettier or ESLint, and has no conflicts with the main branch.
  • The code is compatible with all major browsers and devices, and has no accessibility issues.
  • The code uses Strapi as the backend, and communicates with it using Apollo GraphQL client.
  • The code implements Nuxt features such as SSR, static generation, routing, meta tags, etc., where applicable.
  • [ ]
@devbyray
devbyray / custom-instruction.md
Created September 29, 2023 08:30
Turn ChatGPT to AutoGPT with Custom Instructions
View custom-instruction.md

Act as Professor Synapse🧙🏾‍♂️, a conductor of expert agents. Your job is to support the user in accomplishing their goals by aligning with their goals and preference, then calling upon an expert agent perfectly suited to the task by initializing "Synapse_COR" = "${emoji}: I am an expert in ${role}. I know ${context}. I will reason step-by-step to determine the best course of action to achieve ${goal}. I can use ${tools} to help in this process

I will help you accomplish your goal by following these steps: ${reasoned steps}

My task ends when ${completion}.

${first step, question}."

Follow these steps:

@devbyray
devbyray / chatgpt-template-filled-trip-planner-SF.md
Created September 20, 2023 06:58
Personalised Trip Itinerary Planning Template
View chatgpt-template-filled-trip-planner-SF.md
You are a great travelagent and specialised in planning trips in all kinds of locations. I want you to plan my trip based on all the information below. Use the timetable as a template for each day, so I have a detailed description for each day of the trip.

## General Information
1. **Travel Dates**: October 16th - October 19th
2. **Number of People**: 2
3. **Destination**: San Francisco, CA
4. **Accommodation**: Union Square area
5. **Budget Constraints**: None specified
6. **Preferred Mode of Transportation**: Car rental
@devbyray
devbyray / ChatGPT personalized recipe for kids that don't love veggies.md
Created September 5, 2023 08:33
ChatGPT personalized recipe for kids that don't love veggies
View ChatGPT personalized recipe for kids that don't love veggies.md

Prompt

I want to let my todler eat veggies, but it doesn't want to.  There is now a time he don't want to eat veggies, rice or pasta, it's very difficult. So I thought let's make a {chicken nuggets | pizza | etc} with a with lots of veggies. So he doesn't see the veggies, but get all the good stuff from it. How can I do that, because I'm not a cook.
View Groente-Verpakte Kipnuggets.md

Groente-Verpakte Kipnuggets (Geschikt voor Invriezen) 🇳🇱

Ingrediënten:

  • 500 gram gehakte kip
  • 1 middelgrote wortel, geschild en fijn geraspt
  • 1 kleine courgette, fijn geraspt
  • 1/2 kleine ui, fijngehakt of geraspt
  • 1-2 teentjes knoflook, fijngehakt
  • 1 ei
View Veggie-Packed Chicken Nuggets.md

Veggie-Packed Chicken Nuggets (Freezer-Friendly)

Ingredients:

  • 1 pound minced chicken
  • 1 medium carrot, peeled and finely grated
  • 1 small zucchini, finely grated
  • 1/2 small onion, finely chopped or grated
  • 1-2 cloves garlic, minced
  • 1 egg
View typescript-for-beginners.md
title description date categories published tags image featured
TypeScript For Beginners
In this post, I want to dive into the basics of TypeScript. We’re going to learn primitives, interfaces, enums, classes and a lot more. Sit back, grab your editor and let's get started with learning TypeScript.
2020-04-07T03:19:03.683Z
true
typescript
true
@devbyray
devbyray / is-youtube-url.ts
Created March 31, 2023 11:35
If Youtube URL JavaScript/TypeScript Regex
View is-youtube-url.ts
function isYouTubeUrl(url: string): boolean {
const regex = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:m\.)?youtu(?:\.be\/|be\.com\/watch\?v=|be\.com\/embed\/|be\.com\/v\/|be\.com\/playlist\?list=|be\.com\/.+\/.+\/.+\/.+\/.+\/.)([A-Za-z0-9_-]{11})(?:\S+)?/;
return regex.test(url);
}
View error.txt
node_modules/@supabase/functions-js/dist/module/types.d.ts:1:36 - error TS2304: Cannot find name 'fetch'.
1 export declare type Fetch = typeof fetch;
~~~~~
node_modules/@supabase/functions-js/dist/module/types.d.ts:38:12 - error TS2304: Cannot find name 'File'.
38 body?: File | Blob | ArrayBuffer | FormData | ReadableStream<Uint8Array> | Record<string, any> | string;
~~~~