View is-youtube-url.ts
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
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
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
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; | |
~~~~ |
View nuxt.config.js
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
export default { | |
css: [ | |
'node_modules/lite-youtube-embed/src/lite-yt-embed.css' | |
] | |
} |
View youtube.client.js
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 'lite-youtube-embed' |
View nuxt.config.js
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
export default { | |
plugins: ['@/plugins/youtube.client.js'] | |
} |
View Youtube.vue
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 class="youtube"> | |
<lite-youtube | |
:videoid="id" | |
:playlabel="label" | |
/> | |
</div> | |
</template> | |
<script> | |
export default { |
View youtube-embed.js
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
<youtube id="5SR_NUdg7t8"></youtube> |
View csv-to-array-objects-form.js
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
const form = document.querySelector("#csvForm"); | |
const csvFileInput = document.querySelector("#csvInput"); | |
const textArea = document.querySelector("#csvResult"); | |
form.addEventListener("submit", function (e) { | |
e.preventDefault(); | |
const file = csvFileInput.files[0]; | |
const reader = new FileReader(); | |
reader.onload = function (e) { | |
const csvArray = csvToArr(e.target.result, ","); | |
textArea.value = JSON.stringify(csvArray, null, 4); |
View csv-array-objects.js
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
function csvToArr(stringValue) { | |
// Add logic | |
const [keys, ...rest] = stringVal | |
.trim() | |
.split("\n") | |
.map((item) => item.split(',')); | |
const formedArr = rest.map((item) => { | |
const object = {}; | |
keys.forEach((key, index) => (object[key] = item.at(index))); |
View split-properties.js
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
function csvToArr(stringValue) { | |
// Add logic | |
const [keys, ...rest] = stringVal | |
.trim() | |
.split("\n") | |
.map((item) => item.split(',')); | |
console.log('csv keys: ', keys); | |
console.log('csv values: ', rest); | |
} |
NewerOlder