Skip to content

Instantly share code, notes, and snippets.

View valinet's full-sized avatar

Valentin Radu valinet

View GitHub Profile
@valinet
valinet / Get browser forward gesture on Android 10 Pixel Experience Plus ROM for Poco F1.md
Created June 16, 2020 00:41
Shows how to patch SystemUI with the purpose of achieving said functionality

Get browser forward gesture on Android 10 Pixel Experience Plus ROM for Poco F1

Works in Chrome.

(This technique possibly works for other models as well, but you need to understand it and adapt it for your use case; it is copy-paste for Poco F1 only)

Disclaimer: my code makes the "long swipe" gesture unavailable, as I was not using it, but with patience you can come up with a better patch that may retain that functionality as well. This is more for me to remember how I did it and for educational purposes (finding pertinent and updated Android tutorials on stuff like this is pretty hard).

I have done the process on Windows with the help of WSL2, on Linux it should work 100%, maybe with other utilities.

@valinet
valinet / Overview.md
Last active November 24, 2020 23:06
Overview

Welcome to my Git repo. Bellow you can find a list of projects I am working on, sorted chronologically by date of last 'commit':

  • EtherCard-MDNS - Simple multicast DNS name resolution and service discovery library for EtherCard library that works with the ENC28J60 module.

  • homepi+ - homepi+ is an Arduino based implementation of a home control system. . It interfaces and communicates with various hardware devices in order to provide a single point of control for all of them. It is used to control all the electric and electronic equipment in my study room, from light fixtures to computers and laptops. The user interacts with the service using a simple web application which is accessible from any device which has a browser, so pretty much any modern smart device, and can control it not only from the local network, but also from the larger Internet using a robust and secure security mechanism.

  • [homepi-android-client](htt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>Add</key>
<array>
<dict>
<key>Comment</key>
@valinet
valinet / menubar.uc.js
Last active December 14, 2020 17:37
Moves the menu bar bellow the address bar in Firefox.
// ==UserScript==
// @name menubar on bottom
// @include main
// @author valinet
// ==/UserScript==
UC.menubarbottom = {
resize: function() {
var elem = document.getElementById("TabsToolbar").getElementsByClassName("toolbar-items")[0];
@valinet
valinet / tbforeground.py
Last active December 20, 2020 22:09
Set Thunderbird as the foreground application in Windows, no matter what
# Set Thunderbird as the foreground application in Windows, no matter what
# Copyright (c) 2020 Valentin-Gabriel Radu
#
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2020-12-31T19:52:44.3288116</Date>
<Author>DESKTOP-JIAP5UR\Administrator</Author>
<Description>Center the text in windows' title bars.</Description>
<URI>\WinCenterTitle</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
@valinet
valinet / DumpStringTable.cpp
Last active October 23, 2021 15:30
DumpStringTable
#include <Windows.h>
#include <iostream>
#include <io.h>
#include <fcntl.h>
BOOL EnumresLang(HMODULE hModule, LPCWSTR lpType, LPCWSTR lpName, WORD wLanguage, LONG_PTR lParam)
{
if (lpType == RT_STRING)
{
const HRSRC res = FindResourceEx(hModule, lpType, lpName, wLanguage);
@valinet
valinet / toggle_clock_flyout.c
Last active October 12, 2023 01:31
An example showing an interesting technique necessary to toggle the clock flyout in the Windows 10 taskbar on the monitor containing the mouse
/*
* Example showing an interesting technique necessary to toggle the clock flyout
* in the Windows 10 taskbar on the monitor containing the mouse
*
* Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved.
* License: GPLv2
*/
#include <Windows.h>
#include <TlHelp32.h>
@valinet
valinet / Convert files to PDF using Puppeteer (Chromium).js
Created July 23, 2020 18:35
Convert files to PDF using Puppeteer (Chromium)
/*
Convert files to PDF using Puppeteer (Chromium)
Copyright (c) 2020 Valentin-Gabriel Radu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@valinet
valinet / toast2.c
Last active November 27, 2023 08:08
Send a toast notification in Windows 10/11 using plain C including COM activator
#include <initguid.h>
#include <Windows.h>
#include <roapi.h>
#include <Windows.ui.notifications.h>
#include <notificationactivationcallback.h>
#include <tchar.h>
#include <stdio.h>
#pragma comment(lib, "runtimeobject.lib")
DWORD dwMainThreadId = 0;