Skip to content

Instantly share code, notes, and snippets.

View srestraj's full-sized avatar
🏠
Working from home

Raj Kumar Shrestha srestraj

🏠
Working from home
View GitHub Profile
@srestraj
srestraj / frame-extractor.md
Last active October 8, 2023 05:39
Extract video frame from a file input using JS and Canvas
Create an input element to let users upload a video
<label for="file">Upload Video</label> 
<input type="file" accept=".mp4, .mkv, .mpeg4" id="file" class="video-input">
<button class="capture-btn">Capture</button>
<div class="source-vid"></div>
<div class="result"></div>
@srestraj
srestraj / nuxt-3-gsi.md
Last active September 14, 2024 10:22
Integrate Google Sign-in with Nuxt 3.

Integrate Google Sign-in (Popup method) with Nuxt.js 3 - Works in Incognito mode as well

Add GSI client in your nuxt.config.ts
export default defineNuxtConfig({
  ...
  app: {
    head: {
<template>
<div>
<label for="videourl">
Vimeo or YouTube URL
</label>
<br/>
<input type="text" v-model="videoURL" placeholder="Enter URL" id="videourl">
<div v-if="videoURL != ''">
Extracted Thumbnail: <br/>
@srestraj
srestraj / vue-thumbnail-extractor.md
Last active May 16, 2023 18:57
Vue.js filter to extract YouTube, Vimeo or Dailymotion thumbnail using the video URL

Vue.js filter to extract thumbnail from a YouTube, Vimeo or Dailymotion video

Add the following code to your template videos.vue
<template>
  <div>
    <label for="videourl">
      Vimeo or YouTube URL
    </label>
@srestraj
srestraj / gsi-with-nuxt.md
Last active December 13, 2023 04:50
Integrate Google Sign-in and One-tap with Nuxt.js

Integrate Google Sign-in (Popup method) with Nuxt.js - Works in Incognito mode as well

Nuxt 3 version here.
Add GSI client in your nuxt.config.js
export default {
  ...
@srestraj
srestraj / md-render-inside-nuxt-config.md
Last active April 15, 2022 10:23
render markdown with @nuxtjs/markdownit

Render markdown for your feed module inside nuxt.config.js

Pre-requisite: You should have @nuxtjs/markdownit and @nuxtjs/feed installed

npm i @nuxtjs/markdownit @nuxtjs/feed

Then, configure your nuxt.config.js as follows