Skip to content

Instantly share code, notes, and snippets.

View Marinski's full-sized avatar
🎯
Focusing

Marin Stoyanov Marinski

🎯
Focusing
View GitHub Profile
@Marinski
Marinski / gist:7b7bbd28a97218eddd8663378f0916a9
Created August 15, 2024 07:42
Create database and user in mysql
sudo mysql -u root -p
CREATE DATABASE database_name DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON database_name.* TO 'database_user'@'localhost' IDENTIFIED BY 'user_password';
FLUSH PRIVILEGES;
EXIT;
@Marinski
Marinski / academy-partners-module.php
Last active March 31, 2024 14:37
A custom WordPress plugin to manage partner profiles with custom post types, taxonomies, and meta boxes.
<?php
/**
* Plugin Name: Academy Partners Module
* Description: A custom WordPress plugin to manage partner profiles with custom post types, taxonomies, and meta boxes.
* Version: 1.0
* Requires at least: 5.0
* Requires PHP: 8.0
* Author: Marin Stoyanov
*/
@Marinski
Marinski / LearnPress REST API
Last active March 4, 2023 22:35
LearnPress REST API is a plugin which adds endpoints for LearnPress LMS to the WordPress REST API // EDIT: LearnPress released official version of a REST API for their core plugin. TheYou can read the docs in their website: https://docspress.thimpress.com/developer-learnpress/#sections-5 . LearnPress REST API has been introduced in version 4 of …
<?php
/*
* Plugin Name: LearnPress to WP Rest API
* Plugin URI: https://www.webapp.bg/wp-extensions/learnpress-rest-api
* Description: A plugin to add endpoints for LearnPress to WP REST API
* Version: 1.0
* Author: Marin Stoyanov
* Author URI: https://www.webapp.bg/
* License: GPL2
*/
@Marinski
Marinski / lamp.sh
Created July 22, 2020 11:20 — forked from UbuntuEvangelist/Completely Uninstall LAMP Stack Ubuntu 24.04 LTS
Completely Uninstall LAMP Ubuntu 18.04 LTS
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2
@Marinski
Marinski / WP Schema.org Breadcrumbs without Plugin
Last active March 23, 2024 17:01
WordPress Schema.org breadcrumbs without a plugin
function wordpress_breadcrumbs()
{
// Set variables for later use
$here_text = __( 'You are currently here' );
$home_link = home_url('/');
$home_text = __( 'Home' );
$link_before = '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">';
$link_after = '<meta itemprop="position" content="2" /></span>';
$link_attr = ' itemprop="item"';
$link = $link_before . '<span itemprop="name"><a' . $link_attr . ' href="%1$s">%2$s</a></span>' . $link_after;
// Source: https://blog.templatetoaster.com/update-old-urls-in-database/
// How to Change/Update links with MySQL
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find string’, ‘replace string’);
// For replacing the URL across all database tables, Click on SQL tab and in the panel type the below code:
UPDATE wp_options SET option_value = replace(option_value, 'Existing URL', 'New URL') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'Existing URL', 'New URL');
@Marinski
Marinski / wp_mail.md
Created February 2, 2019 20:35 — forked from johnbillion/wp_mail.md
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.9.

There are a few TODOs left. Please bear with me.

@Marinski
Marinski / facebook-wca-standard-events.html
Created October 15, 2018 20:47 — forked from danielmcclure/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
@Marinski
Marinski / all_my_facebook_photos.html
Created March 27, 2016 21:28 — forked from cbosco/all_my_facebook_photos.html
Simple "get all of my facebook photos" facebook JS SDK + Graph API example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Photos with Friends!</title>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script>
/**
* This is the getPhoto library
*/