Skip to content

Instantly share code, notes, and snippets.

View maikosoft's full-sized avatar

Miguel Martínez maikosoft

View GitHub Profile
@jchristopher
jchristopher / searchwp-customizations.php
Created October 7, 2020 13:22
Customize SearchWP stopwords per Engine
<?php
/**
* Customize SearchWP stopwords per Engine.
*/
// Optional: remove all Stopwords so you can add only unique Stopwords per Engine.
add_filter( 'searchwp\stopwords', '__return_empty_array' );
// Add unique stopword(s) for a single SearchWP Engine.
@jchristopher
jchristopher / searchwp-customizations.php
Created August 31, 2020 12:48
Force quoted search logic in SearchWP when applicable
<?php
// Force multiple word searches to use quoted search logic if quotes are not added.
// NOTE: Quoted search must be enabled (checkbox on the Advanced tab)
add_filter(
'searchwp\query\search_string',
function( $search_string, $query ) {
// If there are already quotes, bail out.
if ( false !== strpos( $search_string, '"' ) ) {
return $search_string;
#!/bin/bash
set -e
# REQUIRED ACTION: Configure your backup server vars - see OVH Server Manager's "Backups" tab.
# BACKUP_HOST_PREFIX: use the prefix domain for the listed "Name" value on the "Backups" tab.
# Example: With a 'Name' value `ftpback-bhs1-3.ip-111-222-333.net` you would need to set `BACKUP_HOST_PREFIX=ftpback-bhs1-3`
# Add something likethese to your ~/.bashrc - /etc/profile
#export OVH_SERVER_ID="ns5xxxxx.ip-x-x-x.net"
#export BACKUP_HOST_PREFIX="ftpback-bhs1-x"
@jonashansen229
jonashansen229 / class.database.php
Last active June 20, 2023 08:41
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";