Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include "plugins.h"
int main()
{
auto &factory = PluginSystem::PluginFactory::Instance();
auto plugin = factory.GetPlugin("Plugin1");
plugin->DoSomething();
@Cilyan
Cilyan / fnv64basedhash.py
Last active May 23, 2022 15:39
Pure Python implementation of FNV64 and a custom hash suitable for urls. The hash prepends a salt in from of the data, then computes the FNV64 hash and encode the data in base64. Remember however that the FNV64 is not a cryptographic hash.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Cilyan Olowen <gaknar@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
@Cilyan
Cilyan / soundtrack.py
Last active December 19, 2021 11:39
Draws the envelop (waveform) of a track on a Gtk.DrawingArea (vertically), uses PyGI and GStreamer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Sources:
#
# https://stackoverflow.com/questions/9344888/getting-max-amplitude-for-an-audio-file-per-second
# https://git.gnome.org/browse/pitivi/tree/pitivi/timeline/previewers.py
# http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-audioconvert.html
# http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-level.html
# https://git.gnome.org/browse/pitivi/tree/pitivi/coptimizations/renderer.c
@Cilyan
Cilyan / ifearly.py
Created January 7, 2021 19:03
Modification of sphinx.ext.ifconfig to run as a Transform as early as possible. By processing the conditions early and removing the nodes that will not go to the final doctree, the goal is to reduce the amount of unexpected errors and warnings that later transforms may face when processing nodes that are not going to be included anyway.
"""
sphinxcontrib.ifearly
~~~~~~~~~~~~~~~~~~~~~
Provides the ``ifearly`` directive that allows to write documentation
that is included depending on configuration variables.
Usage::
.. ifearly:: releaselevel in ('alpha', 'beta', 'rc')
@Cilyan
Cilyan / 95-mkuki-install.hook
Created December 29, 2020 19:37
mkuki: Make Universal Kernel Image
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = usr/lib/modules/*/vmlinuz
Target = usr/lib/initcpio/*
Target = boot/*.img
Target = boot/vmlinuz-*
Target = usr/lib/systemd/boot/efi/linuxx64.efi.stub
Target = usr/share/systemd/bootctl/splash-arch.bmp
@Cilyan
Cilyan / jail.pl
Last active February 29, 2020 18:39 — forked from wilbowma/jail.pl
A perl script to create nginx chroot in arch linux.
#!/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
$BIN = "bin"; # "bin" or "sbin"
@Cilyan
Cilyan / PKGBUILD
Created January 20, 2016 00:41
PKGBUILD for libreoffice-extension-languagetool-nofr, a package that offers the LanguageTool LibO extension without french registered for compatibility with Grammalecte
# Maintainer: 3ED <krzysztof1987 /at/ gmail /dot/ com>
# Contributor: jtts
pkgname=libreoffice-extension-languagetool-nofr
_pkgname=languagetool
pkgver=3.2
pkgrel=1
pkgdesc="An Open Source style and grammar checker. Will not register for french and can this be installed in parallel to Grammalecte"
arch=('any')
url="http://www.languagetool.org/"
@Cilyan
Cilyan / fileinsert.py
Created December 20, 2013 11:33
A class to insert content between two tags in a file (draft)
#
# Copyright 2013 Cilyan Olowen <gaknar@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@Cilyan
Cilyan / 0001-Add-support-for-Excito-B3-Bubba.patch
Created July 27, 2013 23:22
Add support for Excito B3 (Bubba) CONFIG_MACH_BUBBA3 added to config plus some extra modules that are suitable for the device (more modem support, better IPv6 and filtering capabilities, more remote control support) The board file has been added in bubba3.patch: Board configuration + special LED support The PKGBUILD was modified to include the p…
From 863ccb3df64f676237c5a6f63da62b1df2c02921 Mon Sep 17 00:00:00 2001
From: Cilyan Olowen <gaknar@gmail.com>
Date: Sun, 28 Jul 2013 01:07:38 +0200
Subject: [PATCH] Add support for Excito B3 (Bubba)
CONFIG_MACH_BUBBA3 added to config plus some extra modules that are suitable for the device (more modem support, better IPv6 and filtering capabilities, more remote control support)
The board file has been added in bubba3.patch: Board configuration + special LED support
The PKGBUILD was modified to include the patch
Signed-off-by: Cilyan Olowen <gaknar@gmail.com>
@Cilyan
Cilyan / PKGBUILD
Created February 3, 2013 17:24
Updated PKGBUILD for pnmixer-git with automake-1.13
# Maintainer: Nick Lanham <nick@afternight.org>
pkgname=pnmixer-git
pkgver=20130203
pkgrel=1
pkgdesc="PNMixer is a GTK volume mixer applet that runs in the system tray. \
It is lightweight, works with both pulseaudio and alsa, supports mouse wheel \
volume adjustment.
"
arch=('i686' 'x86_64')
license=('GPL')