Skip to content

Instantly share code, notes, and snippets.

View nikola-wd's full-sized avatar
💭
Available for full-time hire. React or Custom WordPress theme development.

Nikola Ivanov nikola-wd

💭
Available for full-time hire. React or Custom WordPress theme development.
View GitHub Profile
@nikola-wd
nikola-wd / custom-search-acf-wordpress.php
Created July 14, 2020 13:28 — forked from charleslouis/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@nikola-wd
nikola-wd / full_list_of_wp_globals.php
Created March 1, 2020 20:32 — forked from kagg-design/full_list_of_wp_globals.php
Full list of WordPress global variables, extracted from WP Coding Standards
<?php
/**
* List of global WP variables.
*
* @since 0.3.0
* @since 0.11.0 Changed visibility from public to protected.
* @since 0.12.0 Renamed from `$globals` to `$wp_globals` to be more descriptive.
* @since 0.12.0 Moved from WordPress_Sniffs_Variables_GlobalVariablesSniff to WordPress_Sniff
*
* @var array
@nikola-wd
nikola-wd / async-await.js
Created January 26, 2020 20:38 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nikola-wd
nikola-wd / remove-woocommerce-styles-scripts.php
Created November 25, 2019 01:55 — forked from gregrickaby/remove-woocommerce-styles-scripts.php
Remove WooCommerce styles and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Manage WooCommerce styles and scripts.
*/
function grd_woocommerce_script_cleaner() {
// Remove the generator tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@nikola-wd
nikola-wd / wordpress.md
Created October 21, 2019 00:11 — forked from jermspeaks/wordpress.md
Resources collected for understanding Wordpress

Wordpress & PHP Resources

Background

I started this markdown file as a place to collect information about Wordpress and PHP when I started programming a Wordpress plugin for the first time. I decided to put out everything I could find in this gist. I will update it occassionally with code examples so I can track my progress in developing Wordpress plugins (or just the one I'm working on at work).

Wordpress 101

Wordpress Environment

@nikola-wd
nikola-wd / google-map-api.html
Created August 3, 2019 17:37 — forked from bavington/google-map-api.html
Simple, custom Google Map (API 3.0)
<!doctype html>
<html>
<head>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script>
<meta charset="UTF-8">
<title>Example Google Map</title>
</head>
<body>
<div id="map-canvas" style="height:400px; width:600px;"></div>
<script>
@nikola-wd
nikola-wd / bitbucket-pipelines.yml
Created July 23, 2019 02:36 — forked from mcnamee/bitbucket-pipelines.yml
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables.
# 2. Commit this file to your repo
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initial GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you
@nikola-wd
nikola-wd / animatedScrollTo.js
Created December 5, 2018 00:54 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@nikola-wd
nikola-wd / mongoose-cheatsheet.md
Created February 23, 2018 09:57 — forked from subfuzion/mongoose-cheatsheet.md
mongoose cheatsheet

Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.

Install

$ npm install mongoose --save

Connect

const mongoose = require('mongoose');