Skip to content

Instantly share code, notes, and snippets.

@vifon
vifon / sedophile.py
Created May 27, 2017 17:52
sedophile
#!/usr/bin/env python3
# sedophile.py --- A library for those who like sed a bit too much.
# Copyright (C) 2017 Wojciech Siewierski
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
@vifon
vifon / keybase.md
Created February 24, 2017 13:21
keybase.md

Keybase proof

I hereby claim:

  • I am vifon on github.
  • I am vifon (https://keybase.io/vifon) on keybase.
  • I have a public key ASBYJ4jZ6inQvVTJ5Ci1ll087nHhQYtIMoWQjW5EjocIBgo

To claim this, I am signing this object:

@vifon
vifon / btrfs-migrate.py
Created December 27, 2016 16:07
btrfs-migrate
#!/usr/bin/env python3
"""Copy a bunch of incremental snapshots to a second btrfs.
"""
import argparse
import subprocess
def btrfs_send(target, snapshot, parent=None, dry_run=False):
"""Send a single snapshot to a target directory, optionally reusing
@vifon
vifon / beet-tag
Created December 19, 2016 23:51
"beet modify" wrapper for files out of the db
#!/bin/bash -e
# beet-tag --- "beet modify" wrapper for files out of the db
# The MIT License
# Copyright (C) 2016 Wojciech Siewierski
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
"add imports on the first line" in withAnalyzer { (dir, analyzerRef) =>
val file = srcFile(dir, "tmp-contents", contents(
"import scala.collection.mutable.Set"
), write = true, encoding = encoding)
val analyzer = analyzerRef.underlyingActor
val procId = 1
analyzer.handleRefactorPrepareRequest(
new PrepareRefactorReq(
@vifon
vifon / wicdctl
Last active August 29, 2015 14:11
Simple wicd-cli wrapper
#!/bin/zsh
zebra()
{
local r=0
while IFS='' read -r line; do
r=$((!r))
(( r )) && print -n '\e[1;34m'
print $line
(( r )) && print -n '\e[0m'
@vifon
vifon / dump_elka.sh
Created April 3, 2014 15:39
Warsaw University of Technology FEIT/WEiTI course dumper
#!/bin/zsh
#########################################################################
# Copyright (C) 2014 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / dmenu_man
Last active December 27, 2015 07:49
#!/bin/zsh
#########################################################################
# Copyright (C) 2013 Wojciech Siewierski, Aleksander Nitecki #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / filebringer
Created September 2, 2012 20:28
filebringer
#!/bin/zsh
#########################################################################
# Copyright (C) 2012 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
@vifon
vifon / colortest.pl
Last active October 10, 2015 00:37
colortest
#!/usr/bin/env perl
#########################################################################
# Copyright (C) 2012 Wojciech Siewierski #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #