Skip to content

Instantly share code, notes, and snippets.

@lahwaacz
lahwaacz / WikiMonkeyLogFilter.py
Last active Aug 29, 2015
small script for filtering Wiki Monkey's logs
View WikiMonkeyLogFilter.py
#! /usr/bin/env python
import sys
import json
class PackageTemplatesFilter:
def __init__(self):
self.pages = {}
def add_log(self, logfile):
@lahwaacz
lahwaacz / cusp PKGBUILD
Created Oct 31, 2014
cleaned up PKGBUILD for AUR/cusp package
View cusp PKGBUILD
# Mantainer: Filippo Squillace <feel dot squally at gmail.com>
# Contributor: Jakub Klinkovský <j.l.k@gmx.com>
pkgname=cusp
pkgver=0.4.0
pkgrel=2
pkgdesc="Generic Parallel Algorithms for Sparse Matrix and Graph Computations on CUDA"
arch=("any")
url="http://cusplibrary.github.io/"
license=("Apache 2.0")
@lahwaacz
lahwaacz / pepperflash PKGBUILD
Created Mar 1, 2015
How to use pkgver() to check for current version
View pepperflash PKGBUILD
pkgname=chromium-pepper-flash
pkgdesc="Google Chrome's Pepper Flash plugin for Chromium (stable version)"
pkgver=16.0.0.305
pkgrel=1
epoch=1
arch=('i686' 'x86_64')
url="http://www.google.com/chrome"
license=('custom:chrome')
conflicts=('chromium-pepper-flash-dev')
install=chromium-pepper-flash.install
View sqlitebrowser.conf
[%General]
language=en_US
recentFileList=/home/lahwaacz/.local/share/qpdfview/qpdfview/database
[MainWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x2\0\0\0\0\x5V\0\0\0\0\0\0\f\xd5\0\0\x4\x37\0\0\x5\x1\0\0\0\x13\0\0\a~\0\0\x4\x36\0\0\0\0\0\x4\0\0\a\x80)
windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\x1\0\0\x1r\0\0\x3\xe2\xfc\x2\0\0\0\x1\xfc\0\0\0?\0\0\x3\xe2\0\0\0\xf0\x1\0\0\x1d\xfa\0\0\0\x2\x2\0\0\0\x3\xfb\0\0\0\xe\0\x64\0o\0\x63\0k\0L\0o\0g\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x8d\0\xff\xff\xff\xfb\0\0\0\x10\0\x64\0o\0\x63\0k\0P\0l\0o\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\xd2\0\xff\xff\xff\xfb\0\0\0\x14\0\x64\0o\0\x63\0k\0S\0\x63\0h\0\x65\0m\0\x61\x1\0\0\0\0\xff\xff\xff\xff\0\0\0m\0\xff\xff\xff\0\0\x6\b\0\0\x3\xe2\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x12\0t\0o\0o\0l\0\x62\0\x61\0r\0\x44\0\x42\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
[PlotDock]
splitterSize=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1\x80\0\0\x1\x90\x1\xff\xff\xff\xff\x1\0\0\0\x2\0)
View cnijfilter-mp280 PKGBUILD
# Maintainer: Alireza Savand <alireza.savand@gmail.com>
# Special thanks to: olive, mirrr, GUiHKX, alessiofachechi, jeremy33,
# jstitch, plv, lahwaacz
pkgname=cnijfilter-mp280
pkgver=3.40.1
pkgrel=4
_pkgrealver=3.40
_pkgrealrel=1
pkgdesc="Canon IJ Printer Driver (mp280 series)"
View utils.py
import itertools
languages = ["en", "cs", "eng", "cze"] # list of language codes
language_separators = [".", "-"] # list of separators (between file name and extension)
subtitle_extensions = ["srt", "sub"] # list of subtitle extensions
def rename_file(old, new):
p("rename %s to %s" % (old, new))
stat = os.stat(old)
os.rename(old, new)
View config-pokus.cpp
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <map>
#include <utility>
#include <algorithm>
// trim from start
static inline std::string &ltrim(std::string &s) {
@lahwaacz
lahwaacz / PKGBUILD
Created Mar 4, 2013
Fixed PKGBUILD for cutechess-git (https://aur.archlinux.org/packages/cutechess-git/). Uses qmake-qt4 instead of qmake4, also first remove build directory - see /usr/share/pacman/PKGBUILD-git.proto
View PKGBUILD
pkgname=cutechess-git
pkgver=20130304
pkgrel=1
pkgdesc="GUI and cli application for automating chess engine tournaments.(xboard & UCI)"
url="http://ajonsson.kapsi.fi/cutechess.html"
arch=('i686' 'x86_64')
license=('GPL3')
depends=('qt4')
makedepends=('git')
source=('cutechess.desktop')
View tiled-windows-border-width.patch
diff --git src/client.c src/client.c
index 7b9790e..db38e8b 100644
--- src/client.c
+++ src/client.c
@@ -1115,7 +1115,8 @@ client_winsize(struct client *c, struct geo *g)
c->wgeo.h = oh = tmp.h - (c->border + c->tbarw);
c->wgeo.w = ow = tmp.w - (c->border << 1);
- client_geo_hints(&c->wgeo, (int*)c->sizeh);
+ if(c->flags & CLIENT_FREE)
@lahwaacz
lahwaacz / dim-abeceda-2.py
Created Mar 7, 2013
Pomocný program k řešení úlohy do DIM
View dim-abeceda-2.py
#! /usr/bin/env python
"""
Zadání úlohy:
Kolik slov délky n lze sestavit v abecedě {A,B,C,D} za podmínky, že prvky A a B nesousedí
(ale A může sousedět s A, B může sousedět s B).
"""
import itertools
from math import sqrt