Skip to content

Instantly share code, notes, and snippets.

View mrkkr's full-sized avatar

Marek mrkkr

  • Poland
View GitHub Profile
@mrkkr
mrkkr / Add google reCaptcha to Wordpress site without plugin
Created February 26, 2018 13:07
Add google reCaptcha to Wordpress site without plugin
https://codeforgeek.com/2014/12/add-google-recaptcha-wordpress/
@mrkkr
mrkkr / fixed_element_after_scrolling.js
Last active February 22, 2018 09:24
Wybrany element staje sie fixed po scrollowaniu do tego elementu #js #css
var fixmeTop = $('.element-fixed');
if (fixmeTop.length) {
var fixmeTopLength = fixmeTop.offset().top; // get initial position of the element
}
$(window).scroll(function() { // assign scroll event listener
var currentScroll = $(window).scrollTop(); // get current position
if (currentScroll >= fixmeTopLength) { // apply position: fixed if you
$('.element-fixed').css({ // scroll to that element or below it
'position': 'fixed',
'top': '137px',
@mrkkr
mrkkr / gzip_deflate_fonts.txt
Created February 5, 2018 15:06
gzip deflate fonts #htacess
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
@mrkkr
mrkkr / placeholder_stylling_css.css
Created January 30, 2018 10:34
Placeholder styling CSS #css
::-webkit-input-placeholder { /* WebKit browsers */
color: #F4F4F4 !important;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #F4F4F4 !important;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #F4F4F4 !important;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
@mrkkr
mrkkr / manually_trim_word_count_post_excerpt.php
Created January 29, 2018 15:05
Ręcznie ustalenie dlugości znaków 'excerpt' postu #php
function custom_excerpt_length( $length ) {
return 30; // limit znakóœ
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
@mrkkr
mrkkr / smooth_scrolling_when_click_anchor_lin_id.js
Created January 18, 2018 11:58
Smooth scrolling po kliknięciu w menu z ID #js
$('a[href*=\\#]').on('click', function(e){
e.preventDefault();
$('html, body').animate({
scrollTop : $(this.hash).offset().top
}, 500);
});
@mrkkr
mrkkr / featured_image_background_image.php
Created January 10, 2018 11:30
Featured Image w background image #php #css
@mrkkr
mrkkr / delete_all_thumbnails_ssh.bash
Created January 5, 2018 14:18
Usunięcie zdjęć miniaturek z folderu /uploads/ w WP przez SSH #bash
find . -name *-*x*.jpg | xargs rm -f
@mrkkr
mrkkr / fadein_on_scroll.js
Created January 2, 2018 15:35
efekt lazy load #js
$(document).ready(function() {
/* Every time the window is scrolled ... */
$(window).scroll( function(){
/* Check the location of each desired element */
$('.hideme').each( function(i){
var bottom_of_object = $(this).offset().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
@mrkkr
mrkkr / accordion_pure_css.html
Created January 2, 2018 11:58
Prosty accordion w czystym CSS #html #css
<a href="#test">Kliknij tutaj</a>
<ul id="test" class="accordion-steps">
<li style="list-style-type: none;"><i class="fa fa-angle-right" aria-hidden="true"></i>EN 1888 dla wózków i spacerówek dziecięcych;</li>
<li style="list-style-type: none;"><i class="fa fa-angle-right" aria-hidden="true"></i>EN 716 dla łóżeczek turystycznych;</li>
<li style="list-style-type: none;"><i class="fa fa-angle-right" aria-hidden="true"></i>EN 12227 dla kojców;</li>
</ul>
<style>
.accordion-steps:target {
display: block;