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 November 13, 2025 15:12
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 November 6, 2025 14:09
IpTables based port forwarding make sure to disable ufw or set rule to make it work

udp port forwarding for any service like postgresql,rtp etc

PUB_IF="eth0"
WG_IF="wg0"

# Forward incoming UDP:8964 on public IP → laptop (10.7.0.2:8964)
sudo iptables -t nat -A PREROUTING -i $PUB_IF -p udp --dport 8964 -j DNAT --to-destination 10.7.0.2:8964

# Allow the traffic to be forwarded
sudo iptables -A FORWARD -i $PUB_IF -o $WG_IF -p udp --dport 8964 -d 10.7.0.2 -j ACCEPT
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" ],