Skip to content

Instantly share code, notes, and snippets.

View GaussianWonder's full-sized avatar
🗿

Teodor GaussianWonder

🗿
View GitHub Profile
@GaussianWonder
GaussianWonder / PacketTracer.desktop
Created November 22, 2022 12:52
Open PacketTracer on kde without broken gui
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=XDG_CURRENT_DESKTOP=GNOME /usr/bin/packettracer
Name=PacketTracer
Comment=PacketTracer
Icon=/opt/packettracer/art/app.png
#!/bin/bash
awkGrab=""
if [ -z "$1" ]
then
awkGrab="all"
else
awkGrab="$1"
fi
@GaussianWonder
GaussianWonder / userChrome.css
Created July 21, 2022 10:46
Smaller and tighter firefox tabs, similar to how chrome/edge renders them.
.tab-background {
border-radius: 10px 10px 0 0 !important;
margin-bottom: 0px !important;
}
.tabbrowser-tab:not([selected=true]):not([multiselected=true]) .tab-background {
background-color: color-mix(in srgb, currentColor 5%, transparent);
}
.tabbrowser-tab {
@GaussianWonder
GaussianWonder / cnp.ts
Created June 21, 2022 13:57
Romanian CNP
/**
* Validate CNP
* @param {string} value CNP
* @returns {boolean} Valid or not
*/
export const cnp = (value: string) => {
var re = /^\d{1}\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])(0[1-9]|[1-4]\d| 5[0-2]|99)\d{4}$/,
bigSum = 0,
rest = 0,
ctrlDigit = 0,
@GaussianWonder
GaussianWonder / lvide.desktop
Created June 12, 2022 15:03
OpenFolder and OpenFile(s) context menu options for kde's file manager DOLPHIN. It uses a script to open a LunarVim config in Neovide.
[Desktop Entry]
Type=Service
Icon=nvim
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=text/plain;
Actions=openFilesInLunarNeovide;
Encoding=UTF-8
X-KDE-AuthorizeAction=shell_access
[Desktop Action openFilesInLunarNeovide]
@GaussianWonder
GaussianWonder / lvide.sh
Last active June 12, 2022 14:59
Start LunarVim in Neovide while still being able to pass arguments to each instance individually. Arguments are separated by "--". First half of the arguments are vim arguments, the other half are neovide arguments.
#!/bin/bash
# find index of $1 in [$2 $3 $4 ...]
function indexof {
search="$1"; shift
i=0
for arg; do
if [ "$search" = "$arg" ]
then
echo $i
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GaussianWonder
GaussianWonder / CMakeLists.txt
Created January 20, 2022 01:37
Macro to auto include all directories that contain headers. Useful when no naming conflicts exist. Benefit of not specifying relative paths to your own headers. This can easily be integrated with conan
# Search all directories that contain headers
macro(HEADER_DIRECTORIES return_list)
file(GLOB_RECURSE new_list *.h)
set(dir_list "")
foreach(file_path ${new_list})
get_filename_component(dir_path ${file_path} PATH)
set(dir_list ${dir_list} ${dir_path})
endforeach()
list(REMOVE_DUPLICATES dir_list)
set(${return_list} ${dir_list})
@GaussianWonder
GaussianWonder / code.desktop
Last active January 17, 2022 09:27
OpenFolder and OpenFile(s) context menu options for kde's file manager DOLPHIN
[Desktop Entry]
Type=Service
Icon=com.visualstudio.code
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
MimeType=text/plain;
Actions=openFilesInVSCode;
Encoding=UTF-8
X-KDE-AuthorizeAction=shell_access
[Desktop Action openFilesInVSCode]
@GaussianWonder
GaussianWonder / split_real_time_rtsp.sh
Created December 21, 2021 21:47
Script to convert real time RTSP input into multiple files. FFMPEG needed. Useful for IP cameras
#!/bin/bash
print_help () {
echo "-h|--host HOST"
echo "-p|--port PORT"
echo "--path PATH"
echo "-U|--user USER"
echo "-P|--password PASSWORD"
echo "t|--time SPLIT INTERVAL"
echo " 00:00:10 (10 seconds)"