Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

NIKOLA PAPRATOVIC npapratovic

🏠
Working from home
View GitHub Profile
View frontend-checklista.md

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
fastest-way-to-load-google-fonts.html
View gist:77e2837a7f9b820e6b1c69c25108afd5
<!--
@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.
View importcontent to wp from joomla xml.php
<?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';
@npapratovic
npapratovic / xml-to-wordpress-importer.php
Created Apr 29, 2020
Example of custom made import script which imports content from xml file. XMl file is pulled from Access db of ASP.NET powered CMS. This exported file containes information of posts which I used to import in WordPress CMS. Script imports posts and images to gallery. Gallery is made as ACF gallery field. Take a look at this example and use it as …
View xml-to-wordpress-importer.php
<?php
/*Only for debugging..*/
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';
@npapratovic
npapratovic / create_featured_image.php
Created Apr 29, 2020
Function to create featured image in WP post
View create_featured_image.php
@npapratovic
npapratovic / import-ics-feed-to-wordpress.php
Last active Feb 11, 2020
Import data to WordPress from .ics feed of most popular booking websites (airbnb.com, booking.com, expediapartnercentral.com)
View import-ics-feed-to-wordpress.php
<?php
error_reporting(-1); // reports all errors
ini_set("display_errors", "1"); // shows all errors
ini_set("log_errors", 1);
ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 6.0)');
// https://github.com/MartinThoma/ics-parser/blob/master/class.iCalReader.php
require_once 'class.iCalReader.php';
@npapratovic
npapratovic / .htaccess
Created Dec 2, 2019 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@npapratovic
npapratovic / wordpress-disable-comments.php
Last active Nov 8, 2019
Wordpress disable comments without plugin, remove links from admin menu (add this code-snippet to functions.php)
View wordpress-disable-comments.php
<?php
/*Disable comments from WordPress*/
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@npapratovic
npapratovic / console.log.css
Created Sep 5, 2019
See the size of each element on the page, their margin and their padding
View console.log.css
/*Different depth of nodes will use different colour allowing you to see the size of each element on the page, their margin and their padding. Now you can easily identify inconsistencies.
*/
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
@npapratovic
npapratovic / mobile-first-css.css
Created Apr 11, 2019
mobile-first-css-breakpoints
View mobile-first-css.css
/* smartphones, portrait iPhone, portrait 480x320 phones (Android) */
@media (min-width:320px) {
}
/* smartphones, Android phones, landscape iPhone */
@media (min-width:480px) {
}