Skip to content

Instantly share code, notes, and snippets.

View gdarko's full-sized avatar
Crunching code, one line at a time.

Darko Gjorgjijoski gdarko

Crunching code, one line at a time.
  • Self-employed
  • The Internet
  • 17:30 (UTC +02:00)
View GitHub Profile
@gdarko
gdarko / linkify.jquery.js
Created April 3, 2016 13:39
jQuery Linkify
$.fn.linkify = function() {
$(this).on("click", function(){
if($(this).attr('data-href')){
window.location.href = $(this).attr('data-href');
}else{
console.log('undefined');
}
})
return this;
};
/**
* Be sure to include library scripts in this order. Can be placed either
* in the header or footer.
*/
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.0b2.120519/jquery.infinitescroll.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js"></script>
@gdarko
gdarko / 01_Laravel 5 Simple ACL manager_Readme.md
Created July 15, 2016 10:16 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@gdarko
gdarko / jquery.persistSortable.js
Created July 20, 2016 11:23
Simple plugin to persist positions of sortable areas
/**
* Copyright (C) 2016 Darko Gjorgjijoski
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@gdarko
gdarko / dg_wp_get_archives.php
Created September 14, 2016 15:58
Modified wp_get_archvies() to accept array as post type so that multiple post types are supported at same time
<?php
/**
* Modified version of the wp_get_archvies()
* This function supports array for the post_type argument so that
* multiple post types are supported at same time
*
* @param $args
* @return mixed
* @author gdarko / http://github.com/gdarko
@gdarko
gdarko / style.css
Last active July 23, 2017 13:06
WordPress Social Sharing Icons
/**
* This is very basic styling
*/
.dg-sharing-icons ul.dg-sharing-icons-inner li i.fa {
color: gray;
}
.dg-sharing-icons ul.dg-sharing-icons-inner li {
display: inline-block;
margin-right: 15px;
}
@gdarko
gdarko / square-hover-boces.html
Last active August 19, 2017 09:12
Beautiful CSS Hover Boxes
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://fonts.googleapis.com/css?family=Playball" rel="stylesheet">
<!-- Bootstrap CSS -->
@gdarko
gdarko / backup.sh
Created September 4, 2017 10:02
VestaCP / BackupWordPress simple backup tool
#!/bin/bash
site=$1
absdir=`pwd`
fulldir="$absdir/$site/public_html/wp-content/backupwordpress*backups"
pubdir="$absdir/$site/public_html"
echo "Running backup"
echo $fulldir
@gdarko
gdarko / style.css
Created October 11, 2017 20:03
WordPress Awesome Comment Styling
ol.comment-list {
list-style: none;
background: #f7f7f7;
padding: 10px;
float: left;
width: 100%;
}
.comment-metadata {
text-align: right;
@gdarko
gdarko / DG_PageTemplater.php
Last active October 20, 2017 07:56
Register WordPress page templates outside the theme
<?php
/**
* This class can be used to register a template outside WordPress theme.
*
* NOTE: This class is fork of the original class which was hardcoded to look for
* the template in the plugin directory. After the modifications i added
* the possiblity new templates to be registered using hook.
*
* @author gdarko
*