This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~/.local/share/Modartt/Pianoteq/Archive/ -type f -name \*.mid | sort | perl -MYAML::XS -nE 'if ( m{(\d{4}-\d{2}-\d{2}).+?(\d+)\s+notes,\s+(\d+)\s+seconds} ) { $s{$1}{notes} += $2; $s{$1}{minutes} += $3 / 60 } else { die } }{ say Dump \%s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log -P --grep "This reverts commit ($( git log --author=$USER --format=%H | head -n 100 | paste '-sd|' ))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -q -s 'https://cast.magicstreams.gr:2199/external/rpc.php?m=recenttracks.get&username=psyndora&charset=&mountpoint=&rid=psyndora&limit=10' | \ | |
jq -c '.data[0][] | [.localtime, .artist, .album, .title]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requirements: curl, ffmpeg, youtube-dl | |
mkdir ttaass.com | |
chdir ttaass.com | |
curl https://www.ttaass.com |\ | |
perl -nE 'say $1 while m{"(http://www\.youtube\.com[^"]+)}g' |\ | |
sort -u |\ | |
xargs -n 1 youtube-dl -f 'bestvideo[ext=mp4,width=1920,height=1080]' | |
# delete the unwanted ones... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# http://www.fundza.com/algorithmic/space_filling/hilbert/basics/ | |
# http://www.soc.napier.ac.uk/~andrew/hilbert.html | |
use strict; | |
use warnings; | |
sub hilbert { | |
my ($n, $x, $y, $xi, $xj, $yi, $yj, $mn) = (@_, qw(0 0 1) x 2, $_[0]); | |
return !$n | |
? [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# inspired by https://randscullard.com/CircleOfFifths/ | |
# and http://pages.mtu.edu/~suits/notefreqs.html | |
use 5.010; | |
use strict; | |
use warnings; | |
use charnames (); | |
use open OUT => ':locale'; | |
use utf8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Carp; | |
use POSIX; | |
# Ported to Perl from: https://github.com/ArashPartow/bitmap/blob/master/bitmap_image.hpp | |
# Credits: Dan Bruton http://www.physics.sfasu.edu/astro/color.html | |
sub convert_wave_length_nm_to_rgb { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mv .git .git.tmp && \ | |
mv .git.bak .git && \ | |
mv .git.tmp .git.bak && \ | |
git checkout . && \ | |
git checkout $(git rev-list --topo-order HEAD..master | tail -1) && \ | |
CMSG=$(git show -s --format=%s) && \ | |
export GIT_COMMITTER_DATE=$(git show -s --format=%cd) && \ | |
export GIT_AUTHOR_DATE=$(git show -s --format=%ad) && \ | |
mv .git .git.tmp && \ | |
mv .git.bak .git && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Net::UPnP::ControlPoint; | |
use WWW::Mechanize; | |
sub sonos_discover { | |
my @hosts; | |
my $cp = Net::UPnP::ControlPoint->new(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" | |
yaml "gopkg.in/yaml.v2" |