Skip to content

Instantly share code, notes, and snippets.

@Spirit-act
Spirit-act / remove_kde.sh
Created April 6, 2023 06:54
Remove KDE clipboard extension
#!/bin/bash
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.clipboard
@Spirit-act
Spirit-act / style.css
Last active March 8, 2022 20:49
Tag Input Script
body {
background-color: #222;
color: white;
}
.input-wrapper{
background: transparent;
padding: 10px;
border-radius: 4px;
border: 1px solid #ccc
}
@Spirit-act
Spirit-act / models.py
Last active December 29, 2021 00:02
python recursive base class which helps displaying objects as string with the help of __repr__ an repr()
# this is a BaseModel which implements the __repr__ method to recursivly convert objects to string
from json import dumps, loads
class Model:
def __repr__(self) -> str:
output: dict = {}
# name must be defined afterwards because of typing
output["name"] = self.__class__.__name__
# loop through all params of the object
@Spirit-act
Spirit-act / .vimrc
Created November 2, 2021 15:26
new .vimrc
scriptencoding utf-8
set encoding=utf-8
set number relativenumber
set mouse=r
set clipboard=unnamed
"-------Tabs no spaces---------
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
@Spirit-act
Spirit-act / .vimrc
Last active November 23, 2021 18:57
scriptencoding utf-8
set encoding=utf-8
set number
set relativenumber
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set smarttab
@Spirit-act
Spirit-act / complementary_calculator.cs
Last active June 4, 2023 07:04
complementary color calculator
using System;
public class Program
{
public static void Main()
{
int[] rgb_color = new int[]{255, 0, 255};
string hex_color = "#FF00FF";
Console.WriteLine(calculate(hex_color));
int[] x = calculate(rgb_color);
@Spirit-act
Spirit-act / ip_regex.md
Created September 19, 2019 05:18
Regex to match all local and private ips

Regex to match all Privates and Local IPs

Need to match:

Subnet Regex
10.0.0.0/8 ^10(\.(0|1[0-9]{0,2}|5[0-5]|[1-9]{2}|[0-4][0-9])){3}$
127.0.0.0/8 ^127(\.(0|1[0-9]{0,2}|25[0-5]|[1-9]{2}|2[0-4][0-9])){3}$
172.16.0.0/12 ^172\.((?P<f>1)?(?(f)[6-9])|(?P<s>2)?(?(s)[0-9])|(?P<t>3)?(?(t)[0-1]))(\.[0-2]([0-5]){0,2}){2}$
192.168.0.0/16 ^192\.168(\.(0|1[0-9]{0,2}|25[0-5]|[1-9]{2}|2[0-4][0-9])){2}$