Skip to content

Instantly share code, notes, and snippets.

View joviczarko's full-sized avatar
🎯
Focusing

Jović Žarko joviczarko

🎯
Focusing
View GitHub Profile
@joviczarko
joviczarko / custom.js
Created June 13, 2018 10:36
Smooth scrolling to a hash plus a scroll class to scroll only those links
// Smooth scrolling to a hash (For links to work you need to add class .scroll)
var hashTagActive = "";
$(".scroll").on("click touchstart" , function (event) {
if(hashTagActive != this.hash) { //this will prevent if the user click several times the same link to freeze the scroll.
event.preventDefault();
//calculate destination place
var dest = 0;
if ($(this.hash).offset().top > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
@joviczarko
joviczarko / functions.php
Created April 13, 2018 08:52
Sending Contact Form 7 data to another system
//Submitting of the form
function cf7_sending_func( $contact_form ) {
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();
$form_params = array(
'email' => $posted_data['your-email'],
'name' => $posted_data['your-name'],
'phone' => $posted_data['your-phone'],
@joviczarko
joviczarko / edd-download-grid-loop.php
Created November 15, 2017 10:54 — forked from Creativenauts/edd-download-grid-loop.php
Easy Digital Downloads - Download Grid Loop Function
function get_edd_posts($per_page, $order, $category = '', $exclude_category = '') {
$exclude_categories = explode(',', $exclude_category);
$product_args = array(
'tax_query' => array (
array(
'taxonomy' => 'download_category', // Download Category
'terms' => $exclude_categories, // Download Category Exclusions
'field' => 'slug', // Term Slug
@joviczarko
joviczarko / dock.bash
Created August 6, 2017 13:45
Make macos dock auto-hide faster
defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock
@joviczarko
joviczarko / Web Contract.md
Last active July 12, 2017 15:31 — forked from malarkey/Contract Killer 3.md
Contract we use for web projects

The Web Project Contract


Between Dewploy Sourcing Ltd.

And [customer name].

Summary:

@joviczarko
joviczarko / custom.js
Created June 23, 2017 13:17
Navbar on scroll change
(function($) {
$(window).scroll(function() {
var height = $(window).height();
if ($(window).scrollTop() / 2 > height) {
$('#header-nav').addClass('scrolled-navbar');
}
@joviczarko
joviczarko / index.html
Created February 13, 2017 12:37
Default underscores HTML
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
<meta name='robots' content='noindex,follow' />
<link rel='stylesheet' id='worato-style-css' href='sass/style.css' type='text/css' media='all' />
<script type='text/javascript' src='js/jquery/jquery.js?ver=1.12.4'></script>
@joviczarko
joviczarko / page-external-posts.php
Created February 3, 2017 11:06
Load external link and parse it as XML and print some parts of it as HTML
<?php
$remote_url = 'https://example.com';
$xml = simplexml_load_file($remote_url);
$number_of_posts = 10;
?>
<ul>
<?php $i = 1; ?>
<?php foreach($xml->channel->item as $job) : ?>
<li>
<div class="jobtitle">
@joviczarko
joviczarko / functions.php
Created January 22, 2017 13:57
Remove Query String from Static Resources .js/?ver=1.2
/* Remove Query String from Static Resources */
/* Resources with a "?" in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources: */
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
@joviczarko
joviczarko / style.css
Last active November 25, 2016 11:03
No bootstraps columns gutter on specific row ( or small gutter)
.row.no-gutter {
margin-left: 0;
margin-right: 0;
}
.row.no-gutter [class*='col-']:not(:first-child),
.row.no-gutter [class*='col-']:not(:last-child) {
padding-right: 0;
padding-left: 0;
}