Skip to content

Instantly share code, notes, and snippets.

@sashagra
sashagra / .gitignore
Last active April 3, 2021 13:16
gitignore for js projects
### Node ###
# Logs
logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Optional npm cache directory
.npm
@sashagra
sashagra / regexpPhoneChecker.js
Last active February 28, 2021 16:16
my own regexp to check phone number
function telephoneCheck(str) {
const regexp = /^(1\s*\(\d{3}\)|1\s\d{3}|\(\d{3}\)|\d{3})(\s|-)*\d{3}(\s|-)*\d{4}$/
return regexp.test(str)
}
const arr = [
"1 555)555-5555", // should return false.
"2 (757) 622-7382", // should return false.
"0 (757) 622-7382", // should return false.
"-1 (757) 622-7382", // should return false
@sashagra
sashagra / convertToRoman.js
Last active February 26, 2021 11:00
javascripr implementation of convert integer to roman
const convertToRoman = num => {
const numbers = {
"1X": "I",
"1V": "V",
"2X": "X",
"2V": "L",
"3X": "C",
"3V": "D",
"4X": "M"
}
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@sashagra
sashagra / index.html
Created May 4, 2020 12:50
webgl fireworks
<canvas id=c></canvas>
@sashagra
sashagra / vootdwnld.sh
Last active August 6, 2022 15:06
bin/bash script for multi episode downloads from voot.com with youtube-dl
#!/usr/bin/env bash
# File links.txt includes urls of pages of episodes separated by space
# Also you need preinstaled youtube-dl. You cat get it from this page:
# https://ytdl-org.github.io/youtube-dl/download.html
readonly filewithurls="links.txt"
readonly ytdltext="Usage: youtube-dl [OPTIONS] URL [URL...]"
j=0
k=0
@sashagra
sashagra / sbttdwnld.sh
Last active October 4, 2019 11:27
bin/bash sript for extracting subtitles from voot.com
#!/bin/bash
echo ----------------- START SCRIPT -----------------
echo "You need run script from folder where is lie 1.m3u8, 2.m3u8, 3.m3u8 etc by episode number."
echo "You can get m3u8 file from episode page by browser dev console on the NET tab."
echo "Just search by "srt" and find "index.m3u8" then open it in new tab and save."
echo "Maybe you will need to refresh page by F5 before you find file index.m3u"
echo "Put the number of next episode to extract subtitles:"
read number
echo "Running extracting from episode $number"