Skip to content

Instantly share code, notes, and snippets.

@iusmac
iusmac / github-release-download-counter.js
Last active January 21, 2023 18:23
Print GitHub release download count per each release found on the "Releases" page.
let getReleaseTag = () => {
let url = document.URL;
const delim = '/releases/tag/';
if (url.includes(delim)) {
return url.split(delim)[1];
}
};
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
@iusmac
iusmac / phpstorm_icache.sh
Last active April 11, 2019 11:04
phpStorm – Improved Cache (ICache): Move the phpStorm cache to RAM while it is in running. MOVED >> https://github.com/iusmac/phpstorm_icache
#!/bin/bash
# Gist: c5f0a118fa07d7be2af85f1b266bff7f
# Url: https://git.io/fhjE8
#
# phpStorm – Improved Cache (ICache)
#
# Move the phpStorm cache to RAM while it is in running. All the cache will be synchronized when phpStorm will be closed.
#
@iusmac
iusmac / lsof_rsync.sh
Created March 9, 2019 23:37
Ignore files in use (opened) while using rsync
lsof_rsync() {
export source_path=$1
local dest_path=$2
find $source_path -type f -exec bash -c \
'full_path=$(sed "s,\\\,,g" <<< $(readlink -f "{}")); if ! lsof "$full_path" > /dev/null; then tmp="{}"; echo ${tmp#$source_path}; fi' \; | \
tr '\n' '\0' | \
rsync -avuq --delete --from0 --files-from=- $source_path $dest_path
}