Skip to content

Instantly share code, notes, and snippets.

@pmayur
pmayur / vimeo-downloader.js
Created Oct 13, 2021 — forked from mistic100/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
View vimeo-downloader.js
// 1. Open the browser developper console on the network tab
// 2. Start the video
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL
// 4. Run: node vimeo-downloader.js "<URL>"
// 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
@pmayur
pmayur / converting_js_to_ts.md
Last active Sep 15, 2021
converting js to ts
View converting_js_to_ts.md

Converting JS to TS

  • Perform tsc --init in the repo for initiating a tsconfig.json file
  • Edit tsconfig.json config as per required
  • Use the following scripts to convert js files to ts one by one
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
  • Use the following script to add // @ts-nocheck comment on top of all ts files to avoid immediate ts errors or don't convert them to ts
View git_commands.md

GIT COMMANDS

$ git reset --hard HEAD

move to head

$ git reset --hard <branch-name>

move to branch

@pmayur
pmayur / resources.md
Created Jan 9, 2021
Resources to understand Javascript advanced concepts
View resources.md
@pmayur
pmayur / understanding_this.md
Created Jan 6, 2021
Understanding this in constructor functions vs regular functions
View understanding_this.md

Understanding calling of this in Javascript

Consider the following function

function Person(name) {
	this.name = name;
	return this;
@pmayur
pmayur / npm.md
Last active Jan 2, 2021
NPM - Sameer Buna
View npm.md

Install package from the github repository

Installs directly from the latest version of the repository upto the latest commit

npm i <package-name>/<repo-name>

npm i express/express