Skip to content

Instantly share code, notes, and snippets.

View zlatko-minev's full-sized avatar
👋

Zlatko Minev zlatko-minev

👋
View GitHub Profile
@zlatko-minev
zlatko-minev / google_scholar_alerts_cancel.js
Created January 3, 2025 19:34
Cancel all google scholar alerts
// This script automates clicking Google Scholar cancel alert and confirm buttons, designed for use in the Chrome developer console. It addresses situations where the page reloads after each click, requiring manual re-execution of the script. Here's how it works:
try{
const cancelButtons = document.querySelectorAll('.gs_btn_flat')
cancelButtons[0].click();
} catch (error) {}
document.querySelector('[name="cancel_alert_btn"]').click();
@zlatko-minev
zlatko-minev / _COPY_FOR_SUBMIT_.sh
Created May 10, 2021 02:18
Example shell script to prepare lyx file to upload to arxiv or to journal with zip
#!/bin/sh
# Tested on MacOS
# @license: APACHE 2.0
# @author: Zlatko K. Minev (2020)
###############################################################
### User define!
alias lyx="/Applications/LyX.app/Contents/MacOS/lyx" # # https://wiki.lyx.org/LyX/ManPage
@zlatko-minev
zlatko-minev / latex_replace_text_by_input_file.py
Last active May 10, 2021 04:20
Break out tables from a tex or latex file into separate tables .tex files..
#!python
"""
Break out tables from a tex or latex file into separate tables .tex files..
To see help
>> python latex_replace_text_by_input_file.py -h
To run user either of:
>> python latex_replace_text_by_input_file.py -f epr-main
>> python latex_replace_text_by_input_file.py -f epr-main -d _SUBMIT_
# Zlatko Minev 2020
# Batch add users from a list to a repository on GitHub.com using their RestV3 API
# from file `names.txt` each new line has a new user id or url
# Also log result to screen and file.
# To test your connection first, try to get user info:
# curl -i -u "${GH_USER}:${PASSWORD}" "https://api.github.com/users/zlatko-minev"
# and see if you get a valid response.
GH_USER="my-user-name"
@zlatko-minev
zlatko-minev / git_commit_by_file.sh
Last active November 10, 2020 00:49
Splitting a Git commit into one commit per file
#!/bin/bash
# Pretty much script from
# https://hisham.hm/2019/02/12/splitting-a-git-commit-into-one-commit-per-file/
# but modified to work with files that have spaces in their names
message="$(git log --pretty=format:'%s' -n1)"
git status --porcelain --untracked-files=no | while read status file
do
printf "\n"
@zlatko-minev
zlatko-minev / update_gitkraken.sh
Created April 16, 2019 18:29 — forked from koter84/update_gitkraken.sh
updater for GitKraken
#!/bin/bash
# get current dir
prog_dir="/opt/$(ls /opt/ | grep gitkraken | grep -v tar)"
if [ "$prog_dir" == "/opt/" ]
then
prog_dir=""
fi
echo "DIR: $prog_dir"
if [ -f $prog_dir/gitkraken ]
@zlatko-minev
zlatko-minev / gitkraken-install-update.sh
Created April 16, 2019 18:28 — forked from rabin-io/gitkraken-install-update.sh
Install Script for Gitkraken on Fedora 27 + Launcher Icon
#!/bin/bash
if [[ ${UID} -ne 0 ]];
then
echo 'This script need to be run with root permissions'
echo "(we assume you don't have write access to /opt)"
exit
fi
@zlatko-minev
zlatko-minev / gitkraken-install-update.sh
Created April 16, 2019 18:28 — forked from rabin-io/gitkraken-install-update.sh
Install Script for Gitkraken on Fedora 27 + Launcher Icon
#!/bin/bash
if [[ ${UID} -ne 0 ]];
then
echo 'This script need to be run with root permissions'
echo "(we assume you don't have write access to /opt)"
exit
fi
#!/usr/bin/env sh
# If the top line line doesn't work, change to #!/bin/bash
# Name: list_users.sh
# Purpose: List all normal user and system groups in the system.
# Tested on RHEL / Debian Linux / BusyBox / GNU/Linux / Mac OS X Sierra Darwin
# Author: Zlatko Minev, based on Vivek Gite, under GPL v2.0+
# Original link: https://www.cyberciti.biz/faq/linux-list-users-command/
# See also: http://tuxthink.blogspot.com/2012/03/look-into-etcpasswdetcshadow-and.html
# -----------------------------------------------------------------------------------