Skip to content

Instantly share code, notes, and snippets.

View michalrus's full-sized avatar

Michal Rus michalrus

View GitHub Profile
@michalrus
michalrus / README.md
Last active April 29, 2023 11:47
Simple Cloze Overlapper template for Anki 2.1 (probably any version, as JavaScript-only)
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE StrictData #-}
{-
Something very similar to this works on 8.2.2, I have it in a
(non-free) codebase, but can’t quite minimize it… Hmm.

Keybase proof

I hereby claim:

  • I am michalrus on github.
  • I am michalrus (https://keybase.io/michalrus) on keybase.
  • I have a public key whose fingerprint is 2A3C E42B E22A 3C5E FBFD C7F8 1341 64FA 6FAF E075

To claim this, I am signing this object:

#!/bin/sh
set -o noclobber
set -o errexit
set -o nounset
pwstore="$HOME/.password-store/"
command -v xdotool >/dev/null || { echo >&1 'xdotool: command not found' ; exit 1 ; }
command -v pass >/dev/null || { echo >&1 'pass: command not found' ; exit 1 ; }
#!/bin/sh
group="-group $(id -g)"
[ "$(ls /tmp/.X11-unix | wc -l)" = "1" ] && group=""
find /tmp/.X11-unix -mindepth 1 -maxdepth 1 -name 'X*' $group -printf '%f\n' | sed -re 's/[^0-9]//g' | while read displ ; do
export DISPLAY=":$displ"
wmctrl -l | cut -d ' ' -f 1 | while read id ; do xprop -id $id -f _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED 32c -set _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED 0x1 ; done
done
object Main extends App {
def fizzBuzz(num: Int, mapping: Map[Int, String]): List[Either[Int, String]] =
(1 to num).toList map { i ⇒
mapping.toList.sorted flatMap {
case (k, v) if i % k == 0 ⇒ List(v)
case _ ⇒ Nil
} match {
case Nil ⇒ Left(i)
case rs ⇒ Right(rs.mkString)
#!/bin/sh
echo '-————————————- Syn -————————————-' # first, sync the db
pacman --color=never --noprogressbar -Sy 2>&1
echo
echo '-————————————- Off -————————————-' # which need upgrading?
pacman --color=never -Qu 2>&1
echo
# Maintainer: Anton Kalmykov <anton dot kalmykov at gmail dot com>
# To disable building of the utility application, add -DBUILD_UTILITY=OFF
# to cmake arguments and then you even can remove qt4 from depends.
_basename=airwave
pkgname=${_basename}-git
pkgver=r46.d314db4
pkgrel=1
pkgdesc="A WINE-based VST bridge, that allows to use Windows VST 2.4 plugins with Linux VST hosts."
1) Extract `wine-l-pa.tar.gz` downloaded from AUR.
2) Patch with `patch -s -Np1 -i wine-l-pa.tar.gz-raw-mouse-input.patch`.
3) `cd wine-l-pa` and `makepkg`.
m.
@michalrus
michalrus / 01-Point.java
Last active December 19, 2015 01:29
Scala *only* as "Java without semicolons". Let's take a look. Equivalent Java-Scala pairs are presented below.
// Let's say we want to create an immutable Point class
public class Point {
public final double x;
public final double y;
public Point(final double x, final double y) {
this.x = x;
this.y = y;