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
  • 15:32 (UTC +01:00)
View GitHub Profile
@gdarko
gdarko / nginx-latest.sh
Last active November 5, 2018 08:41 — forked from Globegitter/nginx-latest.sh
Install the latest nginx from source for Debian 8
# Automatically instal the latest nginx
wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#Make a backup copy of your current sources.list file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#Now copy the following repositories to the end of ` /etc/apt/sources.list`
echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/mainline/debian/ jessie nginx" | tee -a /etc/apt/sources.list
@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;
};
@gdarko
gdarko / vc-twotterbootstrap-grid.php
Last active November 23, 2017 08:14
Easily replace Visual Composer grid columns with Twitter Boostrap columns
<?php
add_filter('vc_shortcodes_css_class', function ($class_string, $tag) {
$tags_to_clean = [
'vc_row',
'vc_column',
'vc_row_inner',
'vc_column_inner'
];
if (in_array($tag, $tags_to_clean)) {
/**
* 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 / file-upload.css
Last active March 11, 2023 21:11
WordPress Custom Profile Image Ajax Upload
.upload-thumb {
display: inline-block;
width: 120px;
height: 120px;
overflow: hidden;
background: #e2e2e2;
border: 1px solid #cdcdcd;
line-height: 120px;
margin-bottom: 10px;
}
@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 -->