Skip to content

Instantly share code, notes, and snippets.

View wiedzmin's full-sized avatar

Alex Ermolov wiedzmin

View GitHub Profile
@wiedzmin
wiedzmin / ffmpeg.md
Created March 25, 2022 17:49 — forked from liangfu/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@wiedzmin
wiedzmin / nyxt.el
Created August 16, 2021 18:16 — forked from gregoryhugaerts/nyxt.el
some emacs nyxt commands
(defun emacs-with-nyxt-sly-connect (host port)
"Connect Sly to HOST and PORT ignoring version mismatches."
(sly-connect host port)
(sleep-for 1))
(defvar emacs-with-nyxt-sly-nyxt-delay 0.3)
(defun emacs-with-nyxt-start-and-connect-to-nyxt (&optional no-maximize)
"Start Nyxt with swank capabilities. Optionally skip window maximization with NO-MAXIMIZE."
(interactive)
(async-shell-command (format "nyxt -e \"(nyxt-user::start-slynk)\""))
@wiedzmin
wiedzmin / README.md
Created May 26, 2021 08:02 — forked from bykvaadm/README.md
Postgres patron backup on Minio with prometheus monitoring

Скрипт не претендует на истину первой инстанции

Да, я знаю что есть способ ${the_best_pg_backup_method}

Это просто скрипт которым я поделился - хочешь пользуйся, не хочешь - иди мимо

@wiedzmin
wiedzmin / testandcover.sh
Created May 14, 2021 07:16 — forked from cdennison/testandcover.sh
Golang test all packages and combine cover profiles
#!/bin/bash
# https://gist.github.com/cdennison/cba009cf297aa2a92759278b5c578ae4
# This script tests multiple packages and creates a consolidated cover profile that's almost identical to coveralls/goveralls
# https://github.com/mattn/goveralls
#
# Inspired by
# https://github.com/getlantern/flashlight-build/blob/devel/testandcover.bash
function die() {
@wiedzmin
wiedzmin / funcs.el
Created February 23, 2021 07:33
timestamp yasnippet for emacs, with ✨ extra bloat ✨
(defvar il/timestamp-map '((year "%Y")
(month "%02m")
(day "%02d")
(nameofday "%A")
(time "%H:%M"))
"Mapping of the components for `il/timestamp'")
(defun il/timestamp (&optional component)
"Inserts components for timestamps.
Components are mapped in the variable `il/timestamp-map'."
@wiedzmin
wiedzmin / go-os-arch.md
Created January 20, 2021 07:35 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.14.7 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • aix
  • android
@wiedzmin
wiedzmin / npm-using-https-for-git.sh
Created December 26, 2020 09:54 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@wiedzmin
wiedzmin / trello_json_to_org.rb
Created November 11, 2020 18:54 — forked from link0ff/trello_json_to_org.rb
Convert Trello JSON export files to Org-mode format
#!/usr/bin/env ruby
# trello_json_to_org.rb
# convert JSON files exported from Trello to https://orgmode.org/ format
#
# Copyright (C) 2020 Juri Linkov <juri@linkov.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@wiedzmin
wiedzmin / dired.sh
Created November 11, 2020 18:03 — forked from alphapapa/dired.sh
Standalone Dired launcher
#!/bin/bash
# Launch Dired in a plain Emacs configuration.
# Arguments are passed to Emacs, e.g. "-nw" works as expected.
emacs -q "$@" \
--eval "(dired default-directory)" \
--eval "(defun kill-window-or-emacs () (interactive) (if (one-window-p) (kill-emacs) (delete-window)))" \
--eval "(setq dired-dwim-target t delete-by-moving-to-trash t)" \
@wiedzmin
wiedzmin / etrace.el
Created October 20, 2020 18:36 — forked from trishume/etrace.el
Emacs Latency Tracing for the Chromium Catapult Trace Event Format
;;; etrace.el --- Emacs Lisp Tracer -*- lexical-binding: t -*-
;; Released under the MIT license
;; This module modifies the instrumentation profiler included with
;; Emacs called "elp" to also record trace events for the beginning
;; and end of function calls, and provides a function to write out
;; those events in Chromium JSON trace format.
;;
;; First use elp commands to instrument the functions you want, then
;; do the thing you want to trace, then M-x etrace-write RET to write
;; out a trace to the configurable etrace-output-file. You can now