Skip to content

Instantly share code, notes, and snippets.

oylenshpeegul /
Created June 10, 2021 22:57
Convert .opus and .m4a files to .mp3
#!/usr/bin/env perl
use v5.28;
use warnings;
use Path::Tiny;
use String::ShellQuote;
my $dir = path(shift // '..');
# Convert the .opus files by piping to opusdec first.
oylenshpeegul /
Last active October 18, 2022 12:30
The from-perl-to-rust Traits page using Object::Pad
#!/usr/bin/env perl
# Would it be worth replacing this Perl code?
use v5.32;
use Object::Pad;
role Area {
requires area;
{"ANA":{"Adam Henrique":{"lastName":"Henrique","nationality":"CAN"},"Ben Hutton":{"lastName":"Hutton","nationality":"CAN"},"Cam Fowler":{"lastName":"Fowler","nationality":"USA"},"Carter Rowney":{"lastName":"Rowney","nationality":"CAN"},"Danton Heinen":{"lastName":"Heinen","nationality":"CAN"},"Derek Grant":{"lastName":"Grant","nationality":"CAN"},"Hampus Lindholm":{"lastName":"Lindholm","nationality":"SWE"},"Isac Lundestrom":{"lastName":"Lundestrom","nationality":"SWE"},"Jacob Larsson":{"lastName":"Larsson","nationality":"SWE"},"Jakob Silfverberg":{"lastName":"Silfverberg","nationality":"SWE"},"Jani Hakanpaa":{"lastName":"Hakanpaa","nationality":"FIN"},"John Gibson":{"lastName":"Gibson","nationality":"USA"},"Josh Mahura":{"lastName":"Mahura","nationality":"CAN"},"Josh Manson":{"lastName":"Manson","nationality":"CAN"},"Kevin Shattenkirk":{"lastName":"Shattenkirk","nationality":"USA"},"Max Comtois":{"lastName":"Comtois","nationality":"CAN"},"Max Jones":{"lastName":"Jones","nationality":"USA"},"Nicolas Deslaurie
#!/usr/bin/env perl
use v5.28;
use warnings;
use experimental qw(signatures);
use Data::Printer;
use Encode qw(encode);
use Getopt::Long::Descriptive;
use Interpolation E => 'eval';
use Mojo::JSON qw(decode_json encode_json);
oylenshpeegul / call_perl.el
Last active August 14, 2016 02:49
Emacs - insert the date with Perl
;; Use some Perl to insert the date.
(defun myday ()
"print the date"
(call-process "perl" nil t nil "-e" "
# perl code here
my @Monat = qw(Januar Februar Maerz April Mai Juni Juli August
September Oktober November Dezember);
my @Tag = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag
oylenshpeegul /
Created June 3, 2015 01:56
Compare Devel::Refcount::refcount with Internals::SvREFCNT
#!/usr/bin/env perl
use v5.16;
use warnings;
use Devel::Refcount qw(refcount);
my $href = {};
say "BEGIN:" . refcount($href);
oylenshpeegul / diamond.go
Last active August 29, 2015 14:14
Emulate Perl's diamond operator in Go.
package main
import (
func main() {
oylenshpeegul /
Created March 17, 2013 21:29
Check a JSON file against a Schema.
#!/usr/bin/env python
import argparse
import json
import jsonschema
parser = argparse.ArgumentParser(
description='validate the json file against the json schema')
'datafile', type=argparse.FileType('r'),
oylenshpeegul /
Created September 16, 2012 23:18
Perl script to download a playlist from
#!/usr/bin/env perl
# Download all the files in a daily playlist from
use v5.16;
use warnings;
$ notes init
Initializing notes (/home/tim/.notes)...
Initialized empty Git repository in /home/tim/.notes/.git/
$ notes add Hello World
Waiting for Emacs...
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>