Skip to content

Instantly share code, notes, and snippets.

View Dovias's full-sized avatar
🎯
Focusing

Dovidas Dovias

🎯
Focusing
  • Software engineering student, VILNIUS TECH University
  • Lithuania.
  • 08:40 (UTC +03:00)
View GitHub Profile
@Dovias
Dovias / terminal-default-application-admin.md
Last active July 6, 2025 02:30
Set Windows 10/11 default terminal for admin privileges

Set Windows 10/11 default terminal for admin and user-level privileges

This tutorial allows you to manually set version of microsoft/terminal to be used as default terminal with and without administrative privileges on Microsoft Windows 10 or 11.

Note

This tutorial is for educational purposes only. I am not responsible for any damages that may have caused this. By attempting to follow this guide, you are on your own risk.

Instructions.

  1. Download unpackaged version of Microsoft Terminal from GitHub. You can find latest working version for this guide here..

[!NOTE]

@Dovias
Dovias / hide-discord-app-bar.js
Last active March 26, 2025 11:26
Hide Discord app bar on web browser (New UI)
// ==UserScript==
// @name Hide Discord App Bar
// @namespace Violentmonkey Scripts
// @match *://discord.com/channels/*
// @grant none
// @version 1.0
// @author Dovias
// @source https://gist.github.com/Dovias/7f2a4d4cf86254e418a6adca9adb1f5f
// @description 3/25/2025, 10:11:25 PM
// ==/UserScript==

pthreads gijos (POSIX)

Sukurti giją galime parašius šį kodą:

int pthread_create(pthread_t *, const pthread_attr_t *, void * (*)(void *), void *);
  • int - skaičius, kurį gražina funkcija atitinkamai ar gija buvo sukurta, ar ne.
  • pthread_t * (unsigned int *) - rodyklė į vietą, kur funkcija išsaugos gijos identifikatorių.
  • pthread_attr_t * - rodyklė į tą vietą, kur saugomi gijai būdingi atributai (gali būti NULL, tada bus naudojami numatyti atributai.)
  • void * (*)(void *) - rodyklė į tą vietą, kur yra saugomas funkcijos kodas.
  • void * - rodyklė į tą vietą, kur saugomas į funkciją paduodamas vienas parametras (gali būti bet kokia reikšmė)
@Dovias
Dovias / local-overrides.quirks
Last active February 24, 2025 00:02
Disable high resolution vertical and horizontal scrolling on Logitech M705 Marathon mouse using libinput override. Put this file under /etc/libinput/ directory, logout and log back in to take this override into effect.
[Logitech M705 Marathon Mouse]
MatchVendor=0x046D
MatchProduct=0x406D
AttrEventCode=-REL_WHEEL_HI_RES;-REL_HWHEEL_HI_RES;
@Dovias
Dovias / dwm-smfact-6.5-unofficial.diff
Created October 30, 2024 12:03
Unofficial dwm 6.5 patch for dwm's smfact patch
--- config.def.h
+++ config.def.h
@@ -4,4 +4,5 @@ /* appearance */
static const unsigned int borderpx = 1; /* border pixel of windows */
static const unsigned int snap = 32; /* snap pixel */
+static const unsigned int minwsz = 20; /* Minimal height of a client for smfact */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
@@ -35,3 +35,4 @@ /* layout(s) */
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
@Dovias
Dovias / dwm-attachaside-6.5-unofficial.diff
Last active October 30, 2024 12:01
Unofficial dwm 6.5 patch for dwm's attachside patch
diff --git a/dwm.c b/dwm.c
index f1d86b2..8b04e0b 100644
--- a/dwm.c
+++ b/dwm.c
@@ -48,7 +48,7 @@
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
-#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
+#define ISVISIBLEONTAG(C, T) ((C->tags & T))
@Dovias
Dovias / types.md
Last active October 7, 2024 17:48
Typescript property substitution utility types

TypeScript recursive property substitution utility types

type IfNever<T, Y, N> = [T] extends [never] ? Y : N;
type Intersects<A, B> = IfNever<Extract<true, A extends B ? true : false>, false, true>;

type DeepSubstitute<
	T,
	K extends PropertyKey,
	SK extends IfNever<K, never, PropertyKey>,
@Dovias
Dovias / Vite.sublime-build
Created March 27, 2024 00:16
Vite build system file for Sublime Text (Needs Terminus package installed)
{
"keyfiles": ["vite.config.ts", "vite.config.js"],
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"variants": [
{
"name": "Build",
"shell_cmd": "npm run build"
},