Skip to content

Instantly share code, notes, and snippets.

@mr-parus
mr-parus / vimeo-downloader.js
Created November 9, 2020 22:33 — forked from alexdrean/vimeo-downloader.js
Download video from Vimeo (chopped m4s files)
// 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>"
// (done automatically now) 5. Combine the m4v and m4a files with mkvmerge
const fs = require('fs');
const url = require('url');
const https = require('https');
const { exec } = require('child_process');
@mr-parus
mr-parus / description.txt
Last active January 9, 2024 12:36
[JS] Alphabetic Anagrams
Task from Codewars: https://www.codewars.com/kata/53e57dada0cb0400ba000688/train/javascript
Consider a "word" as any sequence of capital letters A-Z (not limited to just "dictionary words"). For any word with at least two different letters, there are other words composed of the same letters but in a different order (for instance, STATIONARILY/ANTIROYALIST, which happen to both be dictionary words; for our purposes "AAIILNORSTTY" is also a "word" composed of the same letters as these two).
We can then assign a number to every word, based on where it falls in an alphabetically sorted list of all words made up of the same group of letters. One way to do this would be to generate the entire list of words and find the desired one, but this would be slow if the word is long.
Given a word, return its number. Your function should be able to accept any word 25 letters or less in length (possibly with some letters repeated), and take no more than 500 milliseconds to run. To compare, when the solution code runs the 2
@mr-parus
mr-parus / description.txt
Last active January 10, 2020 21:37
[JS] Monty Hall Problem simulation
One time case simulation:
Initial doors:
1)🚪
2)🚪🎁
3)🚪
--------------------------------------------------
Choosing one door:
Chosen door #3
1)🚪
var theThing = null;
var replaceThing = function () {
var originalThing = theThing;
var unused = function () {
if (originalThing)
console.log("hi");
};
theThing = {
longStr: new Array(1000000).join('*'),
someMethod: function () {