Skip to content

Instantly share code, notes, and snippets.

View bardware's full-sized avatar

Bernhard Döbler bardware

View GitHub Profile
@bardware
bardware / aspec.sh
Created January 3, 2025 23:18
"get spectrogram" solution
#!/bin/bash
# aspec.sh
# get spectrograms of audio streams
#
# usage: aspec.sh a.mp3 b.m4a c.mp4 d.mkv ....
#
# dependencies: sox, ffmpeg
# license: public domain, warranty: none
# version: 2019-05-17 by milahu
@bardware
bardware / add.php
Created November 21, 2024 22:12 — forked from RikudouSage/add.php
<?php
// the function reads the comment added after the function is called using a backtrace and uses them as arguments
function add(): float
{
$trace = debug_backtrace();
$file = $trace[0]['file'];
$line = $trace[0]['line'];
$content = file($file);
@bardware
bardware / gen-flac-visuals
Created November 3, 2024 20:27 — forked from pR0Ps/gen-flac-visuals
Generates spectrogram and waveform images from flac files
#!/bin/sh
# Requires: audiowaveform (https://github.com/bbc/audiowaveform), metaflac, sox
zoom_start=60
zoom_duration=4
zoom_end=$((zoom_start + zoom_duration))
if [ $# -lt 1 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
echo "Generates spectrogram and waveform images from flac files"
@bardware
bardware / Convert audio to video with ffmpeg - examples.md
Created November 2, 2024 23:37 — forked from Neurogami/Convert audio to video with ffmpeg - examples.md
A list of examples on how you can use filters to make visual representations of audio using ffmpeg

Convert audio to video with ffmpeg - examples

ffmpeg -i input.mp3 -filter_complex "[0:a]avectorscope=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a avectorscope.mp4
ffmpeg -i input.mp3 -filter_complex "[0:a]showcqt=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a showcqt.mp4
ffmpeg -i input.mp3 -filter_complex "[0:a]ahistogram=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a ahistogram.mp4
@bardware
bardware / gotcha.md
Created December 28, 2023 22:38 — forked from sheastrickland/gotcha.md
BlockingCollection with Parallel.ForEach with a Partitioner

Lesson Learnt, Streaming Producer / Consumer issue using:

BlockingCollection<T> and Parallel.ForEach(_blockingCollection.GetConsumingEnumerable

Beware default Partitioner algo, which is chunking and buffering.

The GetConsumingPartitioner heading covers it, and also the first comment from Stephen Toub totally nails it. We implemented similar to what commenter Hernan pointed out. Stephen Toub Blog

My absolute saviour, NoBuffering in:

<cfset strName = "fit&gesund">
<cfoutput>
#encodeForHTML( strName )#
<br>#encodeForHTML( strName, true )#
</cfoutput>
<cfset SetLocale("German (Standard)")>
<cfset dOct31 = createDateTime( 2021, 10, 31, 0, 0, 0 )>
<cfset dOct310800 = dateAdd( 'n', 30, dOct31 )>
<cfset dOct310800 = dateAdd( 'h', 8, dOct310800 )>
<cfdump var="#dOct31#">
<cfdump var="#dOct310800#">
@bardware
bardware / qOq_JOIN.cfm
Created November 5, 2019 18:16
JOIN inColdFusion QoQ
<cfset q1=QueryNew(
"Date,User,Col1,Col2,Col3",
"varchar,varchar,integer,integer,integer",
[
{
Date = "08/2019",
User = "Sam",
Col1 = 1,
Col2 = 2,
Col3 = 3
@bardware
bardware / error.log
Created July 30, 2019 20:00
Trying to start CF 9 with jre1.8.0_172
> start server-cf9.json --trace --console
✓ | Starting Server
|------------------------------
| Looking for server JSON file by convention: D:\Webs\CF9.001\server-cf9.json
| webroot defaulted to location of server's JSON file: D:\Webs\CF9.001\
| start server in - D:\Webs\CF9.001\
| server name - cf9001
| server config file - D:\Webs\CF9.001\server-cf9.json
| WAR/zip archive already installed.
| ******************************************
@bardware
bardware / index.cfm
Created March 14, 2019 17:52
Invalid CFML construct found on line 23 at column 36. ColdFusion was looking at the following text: Function
<!---
Invalid CFML construct found on line 23 at column 36.
ColdFusion was looking at the following text:
Function
The CFML compiler was processing:
An expression beginning with callStack, on line 23, column 23.This message is usually caused by a problem in the expressions structure.
A cfset tag beginning on line 23, column 6.