Skip to content

Instantly share code, notes, and snippets.

View dudk's full-sized avatar
🎯
Focusing

Sergei Dudka dudk

🎯
Focusing
  • Uber
  • Utrecht, Netherlands
View GitHub Profile
@dudk
dudk / main.go
Created April 11, 2021 20:25
Demo plugin
// +build plugin
package main
import (
"pipelined.dev/audio/vst2"
)
type Gain struct {
Gain float64
@dudk
dudk / Info.plist
Created March 13, 2021 10:44
Bundle template
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>$PLUGIN_NAME</string>
<key>CFBundleDisplayName</key>
<string>$PLUGIN_NAME</string>
<key>CFBundleExecutable</key>
<string>$DYLIB_NAME</string>
@dudk
dudk / capture.sh
Last active June 12, 2020 09:08
Capture screen and audio with ffmpeg
#!/bin/sh
A="$(pacmd list-sources | grep -PB 1 "analog.*monitor>" | head -n 1 | perl -pe 's/.* //g')"; F="$(date --iso-8601=minutes | perl -pe 's/[^0-9]+//g').mkv"; V="$(xdpyinfo | grep dimensions | perl -pe 's/.* ([0-9]+x[0-9]+) .*/$1/g')"; ffmpeg -loglevel error -video_size "$V" -f x11grab -i :0.0 -f pulse -i "$A" -f pulse -i default -filter_complex amerge -ac 2 -preset veryfast "$F"
@dudk
dudk / assert.go
Last active August 26, 2020 19:44
Functions for equality and panic assertions for go. Allows to avoid any test dependencies.
package test_assert
import (
"reflect"
"testing"
)
func assertEqual(t *testing.T, name string, result, expected interface{}) {
t.Helper()
if !reflect.DeepEqual(expected, result) {
@dudk
dudk / pull-pipelined.sh
Last active September 6, 2019 17:56
pull pipelined
#! /bin/bash
git clone https://github.com/pipelined/audio && \
git clone https://github.com/pipelined/docs && \
git clone https://github.com/pipelined/example && \
git clone https://github.com/pipelined/flac && \
git clone https://github.com/pipelined/mixer && \
git clone https://github.com/pipelined/mock && \
git clone https://github.com/pipelined/mp3 && \
git clone https://github.com/pipelined/phono && \
@dudk
dudk / gotest.sh
Last active July 27, 2019 15:52
go test with coverage
go test ./... -v -race -coverprofile=c.out && go tool cover -html=c.out && rm -r c.out
@dudk
dudk / config.go
Last active May 10, 2019 08:27
Immutable golang package configuration with validation
package config
var (
// Supported is the struct that provides validation logic for wav package values.
Supported = supported{
bitDepths: map[int]struct{}{
8: {},
16: {},
24: {},
32: {},
@dudk
dudk / normal.go
Last active September 24, 2018 05:18
Normal example
package example
import (
"github.com/dudk/phono"
"github.com/dudk/phono/asset"
"github.com/dudk/phono/pipe"
"github.com/dudk/phono/portaudio"
"github.com/dudk/phono/track"
"github.com/dudk/phono/wav"
)
@dudk
dudk / easy.go
Last active September 24, 2018 05:16
Easy example
package example
import (
"github.com/dudk/phono"
"github.com/dudk/phono/pipe"
"github.com/dudk/phono/portaudio"
"github.com/dudk/phono/wav"
)
// Example:
@dudk
dudk / example1.go
Last active September 24, 2018 05:10
phono example 1
package example
import (
"github.com/dudk/phono"
"github.com/dudk/phono/pipe"
"github.com/dudk/phono/portaudio"
"github.com/dudk/phono/wav"
)
// Example: