Skip to content

Instantly share code, notes, and snippets.

View robot-o's full-sized avatar

Dominik robot-o

View GitHub Profile
@robot-o
robot-o / khlavkala.sh
Created June 20, 2017 05:41
backup yo shit
#!/bin/sh
if [ -d "$1" ];
then
sudo rsync -aAXv --progress --exclude={"/files/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/*/.cache/*","/home/*/Sync/*","/home/*/.mozilla/*"} / "$1";
else
echo $'usage:\n'$0' </path/to/target/directory>';
echo $'\nError: invalid target directory, cancelling backup..';
fi
@robot-o
robot-o / listcolors.py
Last active July 17, 2018 03:05
lists all colors in image provided as first argument in hex and rgb
#!/usr/bin/env python2.7
import sys
from PIL import Image
im = Image.open(sys.argv[1])
w, h = im.size
colors = []
for x in range (w):
for y in range(h):
rgb = im.getpixel((x,y))
if rgb not in colors:
@robot-o
robot-o / ff-tst.css
Created December 14, 2018 12:41
Firefox Tree Style Tab Debloat CSS
:root {
--tab-height: 24px !important;
}
.tab {
height: var(--tab-height) !important;
}
.tab:not(:hover) .closebox {
display: none;
}
@robot-o
robot-o / Jenkinsfile
Created May 17, 2019 12:24
Jenkinsfile Snippet to download a Github Release from a private repository via Powershell
pipeline
{
environment
{
REPO_OWNER = "Acme"
REPO_NAME = "Foo"
ARTIFACT_NAME = "Dependency.zip"
}
stages
@robot-o
robot-o / filesort.ps1
Created February 7, 2020 06:01
powershell script that sorts files into folders created based on their creation/modification date
$createdfolders = 0
$movedfiles = 0
Get-ChildItem -Recurse | Where-Object { !$_.PSIsContainer } | ForEach-Object -Process {
$path = $_.FullName
$shell = New-Object -COMObject Shell.Application
$folder = Split-Path $path
$file = Split-Path $path -Leaf
$shellfolder = $shell.Namespace($folder)