Skip to content

Instantly share code, notes, and snippets.

View bogdanmoisin's full-sized avatar

Bogdan Moisin bogdanmoisin

View GitHub Profile
@bogdanmoisin
bogdanmoisin / WP_secondary_editor
Created July 24, 2017 08:11 — forked from dcondrey/WP_secondary_editor
Add a second TinyMCE editor to Wordpress post editor page. The second editor will look, and function exactly like the original one with full toolbar, and support for shortcodes.
/* Second Post Editor TinyMCE Editor */
class SubContentEditor {
public $meta_key = 'subcontent';
public $meta_label = 'Right Side'; // Headline above editor
public $post_type = array( 'page' ); // The post type in which the editor should display
public $wpautop = true; // Automatically create paragraphs?
function __construct() {
add_action( 'edit_form_after_editor', array( &$this, 'edit_form_after_editor' ) );
@bogdanmoisin
bogdanmoisin / SqlQueryTemplates.cs
Created September 22, 2017 06:33 — forked from eshapovalova/SqlQueryTemplates.cs
SQL Queries for TecDOC
namespace GarantaParts.Engine.Import.TecDoc
{
public class SqlQueryTemplates
{
public static string ArticleSearchTemplate = @"
SELECT DISTINCT
TOF_ARTICLES.ART_ID,
TOF_BRANDS.BRA_BRAND,
TOF_SUPPLIERS.SUP_ID,
@bogdanmoisin
bogdanmoisin / woocommerce-ajax-checkout-spinner.css
Created January 29, 2018 07:55 — forked from eversionsystems/woocommerce-ajax-checkout-spinner.css
WooCommerce Change AJAX Spinner Gif On Checkout
/*
* Custom AJAX spinner on WooCommerce checkout
* The class used to load the overlay is .blockUI .blockOverlay
* The class used to load the spinner is .woocommerce .loader:before
*
*/
.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
@bogdanmoisin
bogdanmoisin / woocommerce_update_stock_status.php
Created February 19, 2018 05:55 — forked from codearachnid/woocommerce_update_stock_status.php
set the stock status for all products in your WooCommerce store
<?php
/**
* set the stock status for all products in your WooCommerce store
* @return void
*/
function woocommerce_update_stock_status(){
global $wpdb;
// set all status for products with 0 or less stocked quantity
<?php
/**
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version);
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info()
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems.
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento
* @author Magento Inc.
*/
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@bogdanmoisin
bogdanmoisin / index.php
Created February 16, 2019 09:29 — forked from xeoncross/index.php
Tiny, SMTP client in PHP
<?php
/*
This is a very tiny proof-of-concept SMTP client. Currently it's over 320 characters (if the var names are compressed). Think you can build one smaller?
*/
ini_set('default_socket_timeout', 3);
$user = 'you@gmail.com';
$pass = '';
$host = 'ssl://smtp.gmail.com';
@bogdanmoisin
bogdanmoisin / stuff.cpp
Created June 20, 2019 04:32 — forked from alecgorge/stuff.cpp
notepad++ nppftp decryption routine
// Encryption.cpp
#include <openssl/des.h>
char * Encryption::_DefaultKey = NULL;
bool Encryption::_IsDefaultKey = true;
const char * defaultString = "NppFTP00"; //must be 8 in length
const size_t Encryption::KeySize = 8;
int Encryption::Init() {
_DefaultKey = new char[KeySize];
@bogdanmoisin
bogdanmoisin / nginx.conf
Created August 20, 2019 10:14 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@bogdanmoisin
bogdanmoisin / magento2-disable-unused-modules.sh
Created February 16, 2022 11:01 — forked from ppcdias/magento2-disable-unused-modules.sh
Magento 2.4 Disable Unused Modules to Increase Performance
# magento 2 disable unused modules
bin/magento module:disable Vertex_AddressValidation
bin/magento module:disable Vertex_AddressValidationApi
bin/magento module:disable Vertex_Tax
bin/magento module:disable Temando_ShippingRemover
bin/magento module:disable Dotdigitalgroup_Chat
bin/magento module:disable Dotdigitalgroup_Email