Skip to content

Instantly share code, notes, and snippets.

{"lastUpload":"2017-02-27T22:42:02.156Z","extensionVersion":"v2.5.1"}
@beovulf
beovulf / .vimrc
Last active February 22, 2017 17:52
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@beovulf
beovulf / if_else_lang.php
Created December 1, 2016 08:19
If else language wordpress (polylang)
<?php
$currentlang = get_bloginfo('language');
if($currentlang=="en-GB"):
?>
<?php elseif($currentlang=="pl-PL"): ?>
<?php endif; ?>
@beovulf
beovulf / analitics_no_bounce.js
Last active November 25, 2016 12:52
Analitics no bounce
setTimeout("ga('send', 'event', 'NoBounce', 'Over 10 seconds')",10000);
setTimeout("ga('send', 'event', 'NoBounce', 'Over 30 seconds')",30000);
@beovulf
beovulf / translated_link.php
Created November 19, 2016 10:53
Translated link
@beovulf
beovulf / currency_converter.js
Created March 3, 2016 13:08
currency converter
var numberPattern = /\d+/g;
var currencyType = /(GBP)|(PLN)|(USD)|(EUR)/g;
function httpGet(theUrl){
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}
@beovulf
beovulf / flip_box_X.html
Created February 19, 2016 07:53
Flip box in X axis
<div class="scene3D col-md-3">
<div class="flip">
<div class="card__front" style="background: url('<?php echo $obraz_wyrozniajacy; ?>') center no-repeat; background-size:cover;">
</div>
<!-- This is the Front View-->
<div class="card__back" style="background: url('<?php echo $logo; ?>') center no-repeat; background-size:cover;">
</div>
</div>
</div>
@beovulf
beovulf / smooth scroll.js
Created February 9, 2016 11:07
smooth scroll with links to other pages offset
// Smooth Scroll
$(function() {
$('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-100
@beovulf
beovulf / get_day_of_week.js
Created February 7, 2016 08:33
Get day of week
function getDayOfWeek() {
var newDate = new Date();
newDate = newDate.getDay();
for(i=1;i<=6;i++) {
if(newDate == i) {
$('#day'+i).addClass('active-day').prepend('<p class="today"><b>TODAY</b></p>');
$('#day'+i).parent().css('background-color','#4A9D22');
} else if (newDate == 0 && i == 6) {
$('#day7').addClass('active-day').prepend('<p class="today"><b>TODAY</b></p>');
$('#day7').parent().css('background-color','#4A9D22');
@beovulf
beovulf / print_button.js
Created February 5, 2016 21:45
print button
$('#print').click(function(){
window.print();
});