Skip to content

Instantly share code, notes, and snippets.

View HarasimowiczKamil's full-sized avatar

Kamil Harasimowicz HarasimowiczKamil

View GitHub Profile
// remove keys matching to pattern
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 prefix:*
#COLORS
GREEN := $(shell tput -Txterm setaf 2)
WHITE := $(shell tput -Txterm setaf 7)
YELLOW := $(shell tput -Txterm setaf 3)
RESET := $(shell tput -Txterm sgr0)
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
# A category can be added with @category
HELP_FUN = \
@HarasimowiczKamil
HarasimowiczKamil / merge.js
Created March 18, 2016 08:45
Merge objects in javascript
/**
* Merge objects
*
* @param {...object} obj
*
* @return {object}
*/
function merge() {
var i, obj, key,
result = {};
@HarasimowiczKamil
HarasimowiczKamil / fingerprint.sh
Created August 22, 2017 08:31
Github like ssh key fingerprint
#!/bin/bash
ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub
<?xml version="1.0"?>
<ruleset name="PSR extended">
<description>PSR extended with PEAR comments</description>
<rule ref="PEAR.Commenting.FileComment">
<exclude name="PEAR.Commenting.FileComment.MissingAuthorTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingCategoryTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingLicenseTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/>
<exclude name="PEAR.Commenting.FileComment.MissingPackageTag"/>
# functions
CLREOL=$'\x1B[K'
# ex. tail-color "/path/to/logs.log" "PHRASE TO EXTRA COLOR"
tail-color () {
COLORS="-e 's/\(.*DEBUG.*\)/\o033[32m\1\o033[39m/'"
COLORS="$COLORS -e 's/\(.*NOTICE.*\) /\o033[97m\1\o033[39m/'"
COLORS="$COLORS -e 's/\(.*WARNING.*\) /\o033[93m\1\o033[39m/'"
COLORS="$COLORS -e 's/\(.*ERROR.*\)/\o033[91m\1\o033[39m/'"
set linenumbers
# find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc
# /usr/share/themes/Ambiance/gtk-3.20/gtk.css
textview text {
background-color: white;
}
scrollbar {
background-color: white;
}
@import url("gtk-main.css");
@HarasimowiczKamil
HarasimowiczKamil / repo_scan.sh
Last active August 18, 2023 04:51
Repo analitics
# count commits per file (per author add `--author=John`)
git log --name-only --pretty=format: | sort | uniq -c | sort -nr
# "Cyclomatic Complexity"
grep -oic "[\s]*" filename
# Changelog
git tag -l -n9 --sort=-v:refname