Skip to content

Instantly share code, notes, and snippets.

View nngogol's full-sized avatar

nngogol

View GitHub Profile
@nngogol
nngogol / dec_arg.py
Created December 20, 2020 22:51
decorator with params!
#!/usr/bin/python3
'''
.-----------.
.| decorator |.
/ '-----------' \
/ \
/ \
/ \
----' '------
@nngogol
nngogol / comp.py
Created May 7, 2020 14:19
(async)Racing show in less then 50 lines
'''
Made at 2020-05-07 15:31:52
Asyncio Racing Show
run with:
$ clear; python3 -uB comp.py
'''
import asyncio, random, queue
@nngogol
nngogol / comp_simple.py
Created May 7, 2020 12:36
(async)Racing show in less then 100 lines
'''
Made at 2020-05-07 15:31:52
Asyncio Racing Show
run with:
$ clear; python3 -uB comp_simple.py
'''
@nngogol
nngogol / test_my_keyboard_input.sh
Created April 27, 2020 12:51
Скрипт-тест консольного ввода
#!/bin/bash
#
# ------------------------------------------------------
# [ Дата создания: 2020-04-27 15:47:03
# [ Название файла: test_my_keyboard_input.sh
# [ Название: Скрипт для теста консольный приложений
# [ Автор: nngogol
# ------------------------------------------------------
#
# Интерфейс:
@nngogol
nngogol / installer-py
Created October 18, 2019 10:56
Howdoi python3.8?
# Prerequsitis
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
# Prerequsitis
# downlaod, extract
sudo wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
sudo tar xzf Python-3.8.0.tgz
@nngogol
nngogol / get_a.py
Created February 8, 2019 14:27
get audio
import os
import ffmpeg
import click
@click.command()
@click.option('-f', '--output_format', default='', help='format of output file')
@click.argument('fname', type=click.Path(exists=True))
def cli(output_format, fname):
'''
Вытягивает аудио дорожку из файла.
@nngogol
nngogol / get_v.py
Created February 8, 2019 14:27
get_video
import os
import ffmpeg
import click
@click.command()
@click.argument('fname', type=click.Path(exists=True))
def cli(fname):
'''
Вытягивает видео дорожку из файла.
Использование:
s, sp, padd='*', 2, 45
for i in range(5):
[print(' '*(padd-i), s*i, s*i, ' '*(padd-i), ' '*(padd-i), s*i, s*i, ' '*(padd-i), sep='') for i in range(1, 20, sp)]
[print(' '*(padd-i), s*i, s*i, ' '*(padd-i), ' '*(padd-i), s*i, s*i, ' '*(padd-i), sep='') for i in reversed(range(1, 20, sp))]
print('\n')
@nngogol
nngogol / cmd trick.batch
Created September 2, 2018 14:26
open dir via cmd.exe
cmd /K "cd /d %path_to_directory%\"
Example 1: cmd.exe /K "cd /d D:\music\"
Example 2: cmd.exe /K "cd /d D:\hello world\some folder\music\"
Example 3: cmd.exe /K "cd /d D:\music" - WRONG (no '\' at the end)
@nngogol
nngogol / ffmpeg magic.md
Last active June 1, 2019 09:40
for FAST media conveting

ffmpeg

reduce filesize

ffmpeg -i input.avi -vcodec libx264 -crf 24 output.avi

trim

trim start :

ffmpeg