Skip to content

Instantly share code, notes, and snippets.

View evan-sm's full-sized avatar
🌊

Ivan Smyshlyaev evan-sm

🌊
View GitHub Profile

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
// For example, we have a vector of URLs we want to proccess it concurrently, but what if we have
// 10000 URLs, we do not want to spawn 10000 threads one time. Instead we limit it to 2-3
// threads. Here's how I did it Rust looking at Golang code here: https://github.com/giovanni-orciuolo/cyberdrop-downloader/blob/484bf9fabb6544f4a1a7b640cef635bb37425faa/main.go#L268
const BATCH_SIZE: usize = 2; // How many URLs we want to process each step
fn main() {
let mut albums = vec![
"1".to_string(),
"2".to_string(),
@evan-sm
evan-sm / check.py
Created October 6, 2019 15:18
automatic-twitch-recorder
#This script checks if a user on twitch is currently streaming and then records the stream via streamlink
import datetime
import re
import subprocess
import sys
import os
import getopt
from requests import exceptions as reqexc
from threading import Timer
from twitch import TwitchClient
@evan-sm
evan-sm / simple-webm-converter.sh
Last active April 17, 2016 17:27
Simple WebM converter with automatic bitrate settings for 6 mb output depending on the duration
#!/bin/sh
# Install needed tools:
# brew install sox --with-libvorbis
# brew install ffmpeg --with-libvpx --with-libvorbis --with-opus --with-faac
echo "=== Простой WebM конвертер с автоматическим вычислением битрейта под размер файла ==="
echo "=== Simple WebM converter with automatic bitrate settings for 6 mb output depending on the duration ==="
# Example ./webm.sh 1.mp4 00:01:05 00:01:30
#############################################
ts_get_sec()
{
@evan-sm
evan-sm / convert-to-vp9-ogg-webm-and-normalize-audio.sh
Created April 17, 2016 17:13 — forked from hvrauhal/convert-to-vp9-ogg-webm-and-normalize-audio.sh
This script uses ffmpeg to convert video to vpx9 and audio to vorbis, then sox to normalize audio, and finally ffmpeg to bundle the streams back together
#!/bin/zsh
# Install needed tools:
# brew install sox --with-libvorbis
# brew install ffmpeg --with-libvpx --with-libvorbis --with-opus --with-faac
set -e
FILENAME=$1
echo "Converting $FILENAME to webm + ogg with normalized audio"
ffmpeg -i ${FILENAME} -c:a libvorbis -vn ${FILENAME}_audio_orig.ogg
ffmpeg -i ${FILENAME} -c:v libvpx-vp9 -crf 50 -b:v 0 -vf scale=840:-1 -g 50 -an ${FILENAME}_video_orig.webm