Skip to content

Instantly share code, notes, and snippets.

View shivanshtalwar0's full-sized avatar
💭
Building Januscaler

Shivansh Talwar shivanshtalwar0

💭
Building Januscaler
View GitHub Profile
@shivanshtalwar0
shivanshtalwar0 / async_image_vuejs_directive.md
Created April 6, 2023 10:38
Asynchronously load image through Promise in vue js with directive

Create Global Directive

const vueApp=createApp({})
const replaceElementChildrenWithImage = async (el, binding ) => {
    try {
      const image = await binding.value;
      if (image) el.replaceChildren(image);
    } catch (err) {
      console.error("Image can't be resolved seems like url is broken",err);
    }
@danielwetan
danielwetan / nodejs-cicd-github-actions.md
Last active August 22, 2025 04:23
Deploy Node.js to VPS using Github Actions

Deploy Node.js to VPS using Github Actions

Steps to deploy Node.js to VPS using PM2 and Github Actions

1. Clone repo to VPS folder

@shivanshtalwar0
shivanshtalwar0 / iptable-port-forwarding-vpn.md
Last active January 12, 2025 10:21
IpTables based port forwarding make sure to disable ufw or set rule to make it work

make pupeteer work on arm64 (raspberry pi or orangepi)

  1. Install deps
sudo apt install chromium-browser chromium-codecs-ffmpeg

and specify flags and path

const browser = await puppeteer.launch({
          headless: true,
 executablePath: '/usr/bin/chromium-browser',
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],