Skip to content

Instantly share code, notes, and snippets.

View uptimizt's full-sized avatar
💻
Code is poetry...

Antony I uptimizt

💻
Code is poetry...
View GitHub Profile
@uptimizt
uptimizt / sqlgz.sh
Created October 24, 2018 08:15
Extract Sql.Gz File On Command Line (macos, linux)
gzip -d backup-20100910164109.sql.gz
@uptimizt
uptimizt / wp-upload-image-from-url.php
Created April 17, 2022 08:44 — forked from RadGH/rs_upload_from_url.php
Upload an image to WordPress media gallery from URL
<?php
/**
* Retrieves an image from a URL and uploads it using ld_handle_upload_from_path. See that function for more details.
*
* Note: This function should also work for local file paths as well, but the implementation is slightly different than ld_handle_upload_from_path.
*
* @param $image_url
* @param int $attach_to_post
* @param bool|true $add_to_media
@uptimizt
uptimizt / get_post_by_meta.php
Created April 17, 2022 07:36 — forked from qstudio/get_post_by_meta.php
WordPress / Get Post by Meta Value
<?php
/**
* Get Post object by post_meta query
*
* @use $post = get_post_by_meta( array( meta_key = 'page_name', 'meta_value = 'contact' ) )
* @since 1.0.4
* @return Object WP post object
*/
function get_post_by_meta( $args = array() )
@uptimizt
uptimizt / sochi.md
Last active June 3, 2021 09:19
Sochi links

Sochi (Russian: Со́чи, IPA: [ˈsotɕɪ] (About this soundlisten)) is the largest resort city in Russia. The city is situated on the Sochi River, along the Black Sea in Southern Russia, with a population of 443,562 residents,[11] up to 600,000 residents in the urban area. The city proper covers an area of 176.77 square kilometers (68.25 sq mi), while the Greater Sochi Area covers over 3,502 square kilometers (1,352 sq mi). Sochi stretches across 145 kilometers (90 mi), and is the longest city in Europe,[12] the fifth-largest city in the Southern Federal District, the second-largest city in Krasnodar Krai, and the sixth-largest city on the Black Sea.

Being a part of the Caucasian Riviera, it is one of the very few places in Russia with a subtropical climate, with warm to hot summers and mild to cool winters.

With the alpine and Nordic events held at the nearby ski resort of Rosa Khutor in Krasnaya Polyana, Sochi hosted the XXII Olympic Winter Games and XI Paralympic Winter Games in 2014, as well as the Formula 1

@uptimizt
uptimizt / MultiWH.php
Last active March 17, 2021 17:11
Сниппет для реализации интеграции множества складов и остатков для МойСклад и магазина с WooCommerce, плагин WooMS
<?php
/**
* Plugin Name: WooMS Multi Warehouse
* Plugin URI: https://github.com/wpcraft-ru/wooms/issues/327
* Description: Добавляет механизм сохранения остатков по множеству складов в метаполя продукта
* Version: 1.1
*/
defined('ABSPATH') || exit; // Exit if accessed directly
@uptimizt
uptimizt / index.php
Created October 1, 2018 15:55
Adminer > 3.6.3 auto login for my Vagrant config
<?php
if(empty($_GET['username']) ){
$_GET['username'] = 'vagrant';
}
function adminer_object() {
class AdminerSoftware extends Adminer {
function credentials() {
@uptimizt
uptimizt / plugin.php
Last active January 4, 2021 15:07
ET_Builder_Module_Type_PostBased
<?php
get_template_part( '/includes/builder/module/helpers/Overlay.php' );
class My_Builder_Module_Events extends ET_Builder_Module_Type_PostBased {
/**
* Track if the module is currently rendering to prevent unnecessary rendering and recursion.
*
* @var bool
*/
@uptimizt
uptimizt / .gitlab-ci.yml
Created December 16, 2020 07:25 — forked from khoipro/.gitlab-ci.yml
Deploy from GitLab to WPEngine (Tested)
stages:
- deploy_dev
- deploy_staging
- deploy_live
before_script:
- 'which ssh-agent || ( apk add --update openssh )'
- apk add --update bash
- apk add --update git
- eval $(ssh-agent -s)
@uptimizt
uptimizt / optimizatron.php
Created December 11, 2019 13:40
Optimizatron - Оптимизатрон Фронтэнд - оптимизирует фронтэнд, отключая лишние плагины, снижает нагрузку, ускоряет TTFB
<?php
/*
Plugin Name: Optimizatron
Description: Оптимизатрон Фронтэнд - оптимизирует фронтэнд, отключая лишние плагины, снижает нагрузку, ускоряет TTFB
Version: 1.0
*/
class Optimizatron
{