Skip to content

Instantly share code, notes, and snippets.

View mihdan's full-sized avatar
:octocat:
Code is poetry

Mikhail Kobzarev mihdan

:octocat:
Code is poetry
View GitHub Profile
@mihdan
mihdan / README-WordPress-FULLTEXT-Search.md
Created March 24, 2022 16:55 — forked from jesgs/README-WordPress-FULLTEXT-Search.md
WordPress Full Text Search Examples

Adding MySQL FULLTEXT Support to WordPress

FULLTEXT support to WordPress is simple if you have access to phpMyAdmin. If not, it can still be done but is a little trickier if you’re not used to command-line. We’ll demonstrate how to modify your WordPress database using phpMyAdmin.

How To Modify Database

  1. Start out by having a set of keywords to test against. You’ll need ‘before’ and ‘after’ test results. Also, I can’t stress this enough but back up your database before proceeding!

  2. Next, log into your phpMyAdmin page and navigate to your {prefix}_posts table.

  3. Click on the “Structure” tab.

@mihdan
mihdan / grammarly.sh
Created December 22, 2021 15:24
Script install Grammarly for Linux via PlayOnlinux
#!/usr/bin/env playonlinux-bash
# Date : (2021-04-05 04-20)
# Last revision : (2021-04-05 06-09)
# Wine version used : 6.3 staging
# Distribution used to test : Ubuntu 20.04 LTS
# Author : tiagovla
# PlayOnLinux : 4.3.4
# Script licence : MIT
[ "$PLAYONLINUX" = "" ] && exit 0
@mihdan
mihdan / fish_install.md
Created December 1, 2021 15:33 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1)

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your defaul shell.

Note that you need the https://brew.sh/ package manager.

You can also download the fish app from their website. I do recomand using brew because update are easier.

Install Fish

<?php
function tlap_plugin_default_values(){
$defaults = array(
'tlap_add_analytics_option' => array(
'tlap_excludepage' => '',
'tlap_timer_delay' => '5000',
),
'tlap_add_analytics_option_counters' => array(
@mihdan
mihdan / DNS Prefetch domains
Last active August 20, 2021 18:16 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests examples
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
<?php
function return_canon () {
$canon_page = get_pagenum_link( 1 );
return $canon_page;
}
function canon_paged() {
if ( is_paged() ) {
add_filter( 'wpseo_canonical', 'return_canon' );
}
<?php
add_filter(
'widget_posts_args',
function ( $args, $instance ) {
if ( isset( $instance['cpt'] ) ) {
$args['post_type'] = $instance['cpt'];
}
if ( isset( $instance['order_by'] ) ) {
@mihdan
mihdan / migrate_repo.sh
Created July 6, 2021 16:41 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@mihdan
mihdan / wp-revolution-slider-insert.php
Last active June 2, 2021 21:14
Add Revolution Slider to one of your WordPress site’s Pages
<?php
<!-- Load the slider with "slider1" alias every time -->
<?php putRevSlider("slider1") ?>
<!-- Load the slider with "slider1" alias only on the homepage only -->
<?php putRevSlider("slider1", "homepage") ?>
<!-- Load the slider with "slider1" alias only on a specific page with default permalinks -->