Skip to content

Instantly share code, notes, and snippets.

View crazyyy's full-sized avatar

Vitalii Antoniuk crazyyy

View GitHub Profile
@crazyyy
crazyyy / _readme.md
Last active June 26, 2021 20:33
#git || favorite scripts

GIT

Clean big files

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala

cd git-repo
# https://rtyley.github.io/bfg-repo-cleaner/
wget https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 50M
@crazyyy
crazyyy / load external content into block.js
Last active January 5, 2019 18:29
#js #jquery || load external content into block
$("#content").load("somefile.html", function(response, status, xhr) {
// error handling
if (status == "error") {
$("#content").html("An error occured: " + xhr.status + " " + xhr.statusText);
}
});
@crazyyy
crazyyy / scroll-to-element.js
Last active January 5, 2019 17:58
#js #jquery || slow scroll to top / to element
$("a[href*='#']:not([href='#'])").click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}