Skip to content

Instantly share code, notes, and snippets.


Alexander Drozdov h4tr3d

View GitHub Profile
h4tr3d / 99-99-aur.hook
Created Jan 21, 2020
AUR basic integrity check
View 99-99-aur.hook
# /usr/share/libalpm/hooks/99-99-aur.hook
Operation = Upgrade
Type = Package
Target = *
Description = "Check non-repo packages integrity"
Depends = auracle
When = PostTransaction
h4tr3d / userChrome.css
Last active Jan 21, 2020
My interface customizations for Firefox to live without Classic Theme Restorer
View userChrome.css
@namespace url("");
.tabbrowser-tab:not([pinned]):not([selected]) {
min-width: initial !important;
overflow: hidden;
.tabbrowser-tab:not([pinned]) {
min-width: initial !important;
h4tr3d /
Last active Jan 21, 2020
Qt Creator: show all project files in stocked CMake plugin in Hackers way

Not a question, just a life-hack :-)

Changes, that allows showing all project files in project view is discarded. Clarification that Project View is not a Project View but Build System View is added to the documentation. So, now there is no way to propagate CMakeProjectManager2 changes to the upstream at all.

But we can still display all files using stock plugin and existing functionality. Just hack it using fake CMAKE_TOOLCHAIN_FILE...


  • using file(GLOB_RECURSE ...) scan project tree for files

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

On master:

> git co -b temp
h4tr3d / run-in-terminal.cpp
Created Mar 23, 2016
Check that we run from terminal. If no: restart in the default terminal.
View run-in-terminal.cpp
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <vector>
#include <cstring>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
h4tr3d / v4l2-capture.cpp
Last active Feb 20, 2020 — forked from maxlapshin/capture_raw_frames.c
v4l2 capture example
View v4l2-capture.cpp
* V4L2 video capture example
* This program can be used and distributed without restrictions.
* This program is provided with the V4L2 API
* see for more information
* To build:
* g++ -std=c++11 -o v4l2-capture v4l2-capture.cpp
View gist:d79e2e7def7a907f473f
// Test.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <iostream> // std::cout
#include <algorithm> // std::random_shuffle
#include <vector> // std::vector
#include <ctime> // std::time
#include <cstdlib> // std::rand, std::srand
View ThreadX-arm926ejs.diff
--- openocd-0.8.0/src/rtos/ThreadX.c 2014-03-30 14:54:34.000000000 +1100
+++ 2015-02-05 21:01:35.524321020 +1000
@@ -31,12 +31,17 @@
#include "helper/types.h"
#include "rtos_standard_stackings.h"
+static const struct rtos_register_stacking* get_stacking_info(struct rtos *rtos, int64_t stack_ptr);
+static const struct rtos_register_stacking* get_stacking_info_arm926ejs(struct rtos *rtos, int64_t stack_ptr);
static int ThreadX_detect_rtos(struct target *target);
You can’t perform that action at this time.