Skip to content

Instantly share code, notes, and snippets.

View montrealist's full-sized avatar
📺

Max Kovalenkov montrealist

📺
  • Montreal
View GitHub Profile
@montrealist
montrealist / deploy-to-digital-ocean.markdown
Last active January 7, 2024 11:57
How to deploy files to Digital Ocean when pushing to Gitlab

How to get auto-deploy working from Gitlab to your Digital Ocean (DO) server.

Install https://github.com/olipo186/Git-Auto-Deploy (via apt-get):

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:olipo186/git-auto-deploy
sudo apt-get update
sudo apt-get install git-auto-deploy
@montrealist
montrealist / wp-revslider-import-error.md
Last active October 1, 2023 15:39
WordPress revslider error: slider_export.txt does not exist - Solution

WordPress revslider: slider_export.txt does not exist

problem:

The Slider Revolution WordPress plugin (version 5.1 and earlier) produces an error when one tries to export a slider, and then import the resulting ZIP file into another WordPress installation. The error verbatim:

importing slider settings and data...
Error: slider_export.txt does not exist!

issue:

@montrealist
montrealist / crash-log.log
Created April 7, 2022 19:13
around-stage crash log from Apple - app version: 0.60.30 (17.1.0) 58e7720
Process: Around-stage [87439]
Path: /Applications/Around-stage.app/Contents/MacOS/Around-stage
Identifier: Around-stage
Version: 0.60.30 (0.60.30)
Code Type: X86-64 (Native)
Parent Process: Around-stage [87429]
Responsible: Around-stage [87429]
User ID: 501
Date/Time: 2022-04-07 16:01:28.548 -0300
@montrealist
montrealist / acf_repeater_data_insert_update
Created February 27, 2013 21:39
How to programmatically insert and update Advanced Custom Fields (ACF) repeater data
<?php
$acf_group_title = 'custom-fields-for-event';
$acf_field_title = 'event_ticket_info';
$acf_field_key = '';
$data_to_insert = array(array("sub_field_1" => "Foo1", "sub_field_2" => "Bar1"), array("sub_field_1" => "Foo2", "sub_field_2" => "Bar2"));
$acf_args = array(
'post_type' => 'acf',
'posts_per_page' => 1,
@montrealist
montrealist / 01.xml
Last active April 10, 2021 15:34
XLIFF for ATE Job ID 8934734
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="7304-b2d47ab8abc759630980624c10515af2" source-language="en" target-language="es" datatype="plaintext">
<header>
<phase-group>
<phase phase-name="shortcodes" process-name="Shortcodes identification">
<note>wp_caption,caption,gallery,playlist,audio,video,embed,wpml_language_form_field,acf,wpml_language_switcher,wpml_language_selector_widget,wpml_language_selector_footer,wpml-string,members_login_form,login-form,members_access,access,members_feed,feed,members_logged_in,is_user_logged_in,members_not_logged_in,get_avatar,avatar,wpseo_breadcrumb,call_to_action,newsletter,tours_shortcode,cta_button,woocommerce_thankyou,woocommerce_shop,table,custom_profile,symple_heading,row,tagcloud,sform,nano,add_eventon_list,che,era,essa,nel,gli,per,come,anima,ella,quel,show_gd_mylist_btn,su_spoiler,email,vul,wpv-view,wpv-post-field,accordion_item,ci
@montrealist
montrealist / tinder.sql
Last active December 30, 2020 19:58
sql join on tinder like site
select evalutions.shownId
from evalutions
inner join evalutions as OtherEvaluations
on evalutions.uid = OtherEvaluations.shownId
and OtherEvaluations.res = yes
where evalutions.uid = 'K' and evalutions.res = yes
@montrealist
montrealist / elementor-data.php
Created December 16, 2020 17:09
_elementor_data from postmeta table
Array
(
[0] => Array
(
[id] => fb7667e
[elType] => section
[settings] => Array
(
[stretch_section] => section-stretched
[layout] => full_width
@montrealist
montrealist / create-local-wp-mamp-site-mac.md
Last active December 10, 2020 16:44
Steps for creating a local MAMP site on Mac

Updated MAMP and it's no longer working?

/Applications/MAMP/conf/apache/httpd.conf needs this line to be uncommented:

# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

Also MAMP might replace this file with a default version, so make sure to back it up.

<?php
namespace AvanteElementor\Widgets;
use Elementor\Widget_Base;
use Elementor\Controls_Manager;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Elementor Portfolio Classic
@montrealist
montrealist / gist:18e000c022333832719d4f524842d6c1
Created October 27, 2020 12:56 — forked from yunusga/gist:33cf0ba9e311e12df4046722e93d4123
Debug WordPress 404 issues (permalinks, rewrite rules, etc.)
/* Produces a dump on the state of WordPress when a not found error occurs */
/* useful when debugging permalink issues, rewrite rule trouble, place inside functions.php */
ini_set( 'error_reporting', -1 );
ini_set( 'display_errors', 'On' );
echo '<pre>';
add_action( 'parse_request', 'debug_404_rewrite_dump' );
function debug_404_rewrite_dump( &$wp ) {