Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Code is poetry

Mikhail Kobzarev mihdan

:octocat:
Code is poetry
View GitHub Profile
View gutenberg-set-default-nav-type.php
<?php
add_action(
'enqueue_block_editor_assets',
function() {
wp_register_script(
'mihdan-editor-js',
get_theme_file_uri( 'js/editor.js' ),
[ 'wp-blocks' ],
filemtime( get_theme_file_path( 'js/editor.js' ) ),
true
View README-WordPress-FULLTEXT-Search.md

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 Dec 22, 2021
Script install Grammarly for Linux via PlayOnlinux
View grammarly.sh
#!/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 Dec 1, 2021 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew
View fish_install.md

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

View defaults-2.php
<?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 Aug 20, 2021 — forked from lukecav/DNS Prefetch domains
WP Rocket - Advanced Options Prefetch DNS requests examples
View DNS Prefetch domains
//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
View wpseo-pagination-canonical.php
<?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' );
}
View wpseo-remove-prev-next-links.php
View wp-extend-recent-posts-widget.php
<?php
add_filter(
'widget_posts_args',
function ( $args, $instance ) {
if ( isset( $instance['cpt'] ) ) {
$args['post_type'] = $instance['cpt'];
}
if ( isset( $instance['order_by'] ) ) {
View migrate_repo.sh
# 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.