Skip to content

Instantly share code, notes, and snippets.

View npapratovic's full-sized avatar
🏠
Working from home

NIKOLA PAPRATOVIC npapratovic

🏠
Working from home
View GitHub Profile
@npapratovic
npapratovic / extend-vendor-function.md
Created January 26, 2023 11:39
Right way to extend, modify and use function from vendor folder in your own code
  1. extend class in your /helpers or similar folder
  2. copy and modify function from original class, don't forget to add namespace in new class
  3. call new extended class in your code and use function from new class

NOTE: if this functionality or fix is really usefull for others, fork clone edit original repo and make PR so others can benefit from your work too :)

@npapratovic
npapratovic / GitHub-Forking.md
Created January 26, 2023 11:33 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@npapratovic
npapratovic / git-sync-branch-with-master.md
Last active January 10, 2023 09:52
Sync current branch with master / main branch to avoid merge conflicts
  1. Do all work on separate branch
  2. Commit and push to origin
  3. Checkout master branch
  4. Git pull master
  5. Checkout separate branch
  6. Git merge origin/master branch into separate branch
  7. Git push
@npapratovic
npapratovic / git-head-status.md
Last active December 8, 2022 14:25
git Attached / Detached HEAD explained

Detached head means:

  1. You are no longer on a branch,
  2. You have checked out a single commit in the history

If you have no changes: you can switch to master by applying the following command

git checkout master

If you have changes that you want to keep:

Commit Message Convention:

Template:

Commit title: type + subject

Commit body

Commit footer

//HTML part
<div class="slider-wrapper">
<button id="right-btn"></button>
<button id="left-btn"></button>
<div class="slider-images">
<img src="img-name.jpg" />
<img src="img-name2.jpg" />
<img src="img-name3.jpg" />
<img src="img-name4.jpg" />
</div>
@npapratovic
npapratovic / ajax-call-to-remote-change-DOM.html
Last active July 12, 2022 10:36
On button click start function with ajaxcall to remote to fetch data and store data in another div
<a id="clickme">Click me!</a>
<div id="populateme"></div>
<script>jQuery(function ($) {
$(document).ready(function(){
var getdest = '/session/getdest';
$(document).on('click', '#clickme', function() {
changeDiv();
});
function changeDiv() {

Requirements:

  1. Clear cache chrome extenzija: https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en
  2. EditthisCookie chrome extenzija https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=en

VIZUALNI I FUNKCIONALNI PREGLED

  1. Ako su izmjene samo na razini dizajna - razmaci, fontovi, margine, labele - dovoljno je samo napraviti vizualni pregled u preglednicima, i kroz sve uređaje. (VIDI PROVJERA DIZAJNA)
  2. Ako su izmjene funkcionalnosti web stranice pr. dodavanje polja u formi, popup prozori, obavijest o kolačićima, dodavanje videa u pozadinu, integracija sa kalendarom, dodavanje novih oblika plaćanja na web stranicu itd. - tada radimo vizualni i funkcionalni pregled web stranice (VIDI PROVJERA FUNKCIONALNOSTI)
@npapratovic
npapratovic / gist:77e2837a7f9b820e6b1c69c25108afd5
Created May 26, 2020 09:44
fastest-way-to-load-google-fonts.html
<!--
@source https://csswizardry.com/2020/05/the-fastest-google-fonts/
To make the snippets easier to read, I’m going to replace all instances of https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700 with $CSS.
-->
<!--
- 1. Preemptively warm up the fonts’ origin.
-
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in
- most modern browsers.
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
ini_set('max_execution_time', 0); // for infinite time of execution
// require wp-load.php to use built-in WordPress functions
require_once '../wp-load.php';
require_once ABSPATH . 'wp-config.php';
require_once ABSPATH . 'wp-includes/wp-db.php';
require_once ABSPATH . 'wp-admin/includes/taxonomy.php';