Skip to content

Instantly share code, notes, and snippets.

View fosemberg's full-sized avatar
💭
work hard

Bugakov Mikhail fosemberg

💭
work hard
View GitHub Profile
git fsck --full --no-reflogs --unreachable --lost-found | grep blob | cut -d\ -f3 | while read in; do printf "blob: $in\n"; git cat-file -p $in; printf "\n--------------------------------\n"; done > recover.txt
// ==UserScript==
// @name Mondit
// @namespace http://tampermonkey.net/
// @version 0.6
// @description try to take over the world!
// @author You
// @match https://mondit.alpari-ru.dom/monitoring/app
// @grant none
// ==/UserScript==
@fosemberg
fosemberg / config
Last active December 16, 2019 11:11
git config for project. add projectPrefix while checkouting (Win10 x64 WSL Ubuntu 18.04)
...
[alias]
co = "!f() { \
local projectPrefix=DITBL-; \
if [ $1 = "d" ] || [ $1 = "dev" ] || [ $1 = "develop" ]; then \
git checkout develop; \
elif [ $1 = "m" ] || [ $1 = "master" ] || [ $1 = "v2" ]; then \
git checkout v2; \
elif [ $1 != "$projectPrefix"* ]; then \
git checkout $projectPrefix$1; \
@fosemberg
fosemberg / config
Created November 6, 2019 09:13
git config for project. add projectPrefix while checkouting
...
[alias]
co = "!f() { \
local projectPrefix=DITBL-; \
local branch=$1; \
if [[ "$1" != "$projectPrefix"* ]]; then \
branch=$projectPrefix$branch; \
fi; \
if [[ $1 = "d" || $1 = "dev" || $1 = "develop" ]]; then \
git checkout develop; \
@fosemberg
fosemberg / commit-msg
Created November 6, 2019 08:55
git hook commit-msg (path to insert: .git\hooks\)
#!/bin/sh
#
# Hook script to prepend the commit log message with a branch name
# Not prepend the name of the branch only if:
# - branch name starts with one of the options in $NO_PREFIX_IF_BRANCH_STARTSWITH
# - commit message starts with one of the options in $NO_PREFIX_IF_THIS_IN_COMMIT_MESSAGE
# - branch name has been manually prepended in the commit message
# lnk: https://gist.github.com/shevaroller/680719f31e610cff3e6d8c930a078eb0
# edited by fosemberg