Skip to content

Instantly share code, notes, and snippets.

View gist:4cddaf3e81f76ccba63f33a7fc610548
That is, that Father Chambers (?) & our lady of the abbey (?) could be brought together
and could better agree than they could until now
which (on the contrary | in the area) causes great unrest
the reason why, nobody knows, except themselves
@remko
remko / to_metadata.rb
Last active Dec 28, 2017
Converts a list of files to FFmpeg's metadata format
View to_metadata.rb
#!/usr/bin/env ruby
require 'csv'
def parse_csv(s)
return CSV.parse(s)[0][0]
end
title = parse_csv(`ffprobe -i \"#{ARGV[0]}\" -show_entries format_tags=album -v quiet -of csv=\"p=0\"`)
artist = parse_csv(`ffprobe -i \"#{ARGV[0]}\" -show_entries format_tags=artist -v quiet -of csv=\"p=0\"`)
@remko
remko / cue2ffmeta.rb
Last active Nov 19, 2020
Script to convert .cue files to FFMPEG metadata files
View cue2ffmeta.rb
#!/usr/bin/env ruby
# Simple script to convert .cue files to FFMPEG Metadata files
# This can then be fed to ffmpeg to add chapters etc. to
# an MP4 or MKV file, e.g.
#
# ./cue2ffmeta.rb <FILE>.cue <TOTAL_LENGTH_IN_SECONDS> > metadata.txt
# ffmpeg -i <INPUT> -i metadata.txt -map_metadata 1 -codec copy <OUTPUT>
#
# (the TOTAL_LENGTH_IN_SECONDS is optional)
View mutt-trashfolder.diff
diff -urN mutt-1.5.24/PATCHES mutt-1.5.24.new/PATCHES
--- mutt-1.5.24/PATCHES 2015-08-30 19:06:38.000000000 +0200
+++ mutt-1.5.24.new/PATCHES 2015-12-23 22:50:08.000000000 +0100
@@ -0,0 +1 @@
+patch-1.5.16hg.cd.trash_folder.vl.1
diff -urN mutt-1.5.24/commands.c mutt-1.5.24.new/commands.c
--- mutt-1.5.24/commands.c 2015-08-30 19:18:28.000000000 +0200
+++ mutt-1.5.24.new/commands.c 2015-12-23 22:50:08.000000000 +0100
@@ -720,6 +720,7 @@
if (option (OPTDELETEUNTAG))
View keybase.md

Keybase proof

I hereby claim:

  • I am remko on github.
  • I am remko (https://keybase.io/remko) on keybase.
  • I have a public key whose fingerprint is E00B 5436 4600 75B9 05D1 C7BE F01E 29A2 3F4B 0D61

To claim this, I am signing this object:

@remko
remko / mergebst.hs
Created Dec 1, 2012
Merge Binary Search Trees
View mergebst.hs
import Data.List
import Data.Array
data Tree a = Leaf | Node a (Tree a) (Tree a) deriving (Show, Eq)
-- Flatten a Binary Search Tree into a sorted list
flatten :: Tree a -> [a]
flatten Leaf = []
flatten (Node n l r) = (flatten l) ++ n : flatten r
@remko
remko / gist:4131496
Created Nov 22, 2012
Swiften: Connect over BOSH
View gist:4131496
#include <Swiften/Swiften.h>
using namespace Swift;
int main(int, char**) {
SimpleEventLoop eventLoop;
BoostNetworkFactories networkFactories(&eventLoop);
Client* client = new Client("me@server.lit", "mypassword", networkFactories); /* Substituting the JID and password accordingly. */
@remko
remko / gist:4131484
Created Nov 22, 2012
Connecting over BOSH with Swiften
View gist:4131484
#include <Swiften/Swiften.h>
using namespace Swift;
int main(int, char**) {
SimpleEventLoop eventLoop;
BoostNetworkFactories networkFactories(&eventLoop);
Client* client = new Client("me@server.lit", "mypassword", networkFactories); /* Substituting the JID and password accordingly. */
@remko
remko / CryptoPassCLI.cpp
Created Jan 15, 2012
Native, command-line version of CryptoPass using Swiften
View CryptoPassCLI.cpp
/*
* Native, command-line version of CryptoPass ( http://tinyurl.com/cryptopass )
* using the Swiften library ( http://swift.im/swiften )
*
* Copyright (c) 2012 Remko Tronçon
* Licensed under the GNU General Public License v3
*/
#include <Swiften/Base/Platform.h>
#include <Swiften/StringCodecs/PBKDF2.h>