Skip to content

Instantly share code, notes, and snippets.

View andrey-str's full-sized avatar

Andrey Streltsov andrey-str

View GitHub Profile
@andrey-str
andrey-str / gist:297792bff6d131497ee6dc1b789e100d
Created May 8, 2018 21:24 — forked from sparlampe/gist:5b9dc019a62db8a19941f6526e39dff1
OVMF passthrough of RX570 over Thunderbolt3 on Thinkpad P50
prompt:/# kvm -version
QEMU emulator version 2.9.0 (v2.9.0-dirty)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers
prompt:/# uname -a
Linux ThinkPad-P50 4.13.8-041308-generic #201710180430 SMP Wed Oct 18 08:33:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@andrey-str
andrey-str / convert.sh
Created May 10, 2018 00:11 — forked from akost/convert.sh
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
@andrey-str
andrey-str / main.cpp
Created September 13, 2018 10:56
Blur QWidget window content(with any 3D on top)
namespace
{
QImage applyEffectToImage(QImage src, QGraphicsEffect *effect)
{
if(src.isNull()) return QImage(); // No need to do anything else
if(!effect) return src; // No need to do anything else
QGraphicsScene scene;
QGraphicsPixmapItem item;
item.setPixmap(QPixmap::fromImage(src));
item.setGraphicsEffect(effect);