Skip to content

Instantly share code, notes, and snippets.

View zorca's full-sized avatar
✴️
Working from a faraway star

Zorca Orcinus zorca

✴️
Working from a faraway star
View GitHub Profile
/**
* После добавления товара в корзину - показать мадолбное окно
*/
$( document.body ).on('adding_to_cart', function( a, b ) {
var $btn = $( b[0] );
var product_title = $btn.data('product_title');
if ( product_title ) {
var tpl = '';
@zorca
zorca / database.php
Created July 16, 2019 18:19 — forked from tigusigalpa/database.php
Laravel PostgreSQL SSL encryption connection config
<?php
/**
* 1. You have to store your client SSL certificates on your Laravel server, in my case this is /var/certs/mydomain.com/...
* 2. You have to right select SSL mode for PostgreSQL (see https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS), verify-full means your server CA is signed for real domain name for the PostgreSQL server (recommended)
* 3. Go to Laravel config/database.php to the section 'pgsql' and extend it to the following:
*/
return [
/*...*/
'connections' => [
/*'mysql' etc*/
@zorca
zorca / gist:e751654dec0a6481e0c356fd1c756b22
Created September 5, 2019 07:02 — forked from kagg-design/gist:7cbda38a3ce76c0502748f8ddbc9bebe
Remove current action or filter from plugin
<?php
/**
* Remove current action or filter from plugin
*
* @param string $class_name Class name enqueueing the action.
* @param null $action_name Action name.
*/
function remove_plugin_action( $class_name, $action_name = null ) {
global $wp_filter;
@zorca
zorca / .editorconfig
Created September 15, 2019 10:42 — forked from davidlonjon/.editorconfig
.editorconfig for WordPress
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
<section class="elementor-element elementor-element-8a510f3 elementor-section-content-middle elementor-section-boxed ang-section-padding-no elementor-section-height-default elementor-section-height-default default-style elementor-section elementor-inner-section" data-id="8a510f3" data-element_type="section" data-settings="{&quot;rt_color_sets&quot;:&quot;default-style&quot;}">
<div class="elementor-container elementor-column-gap-default">
<div class="elementor-row">
<div class="elementor-element elementor-element-5f40b76 elementor-column elementor-col-50 elementor-inner-column" data-id="5f40b76" data-element_type="column">
<div class="elementor-column-wrap elementor-element-populated">
<div class="elementor-widget-wrap">
<div class="elementor-element elementor-element-7226505 elementor-widget elementor-widget-heading" data-id="7226505" data-element_type="widget" data-widget_type="heading.default">
<div class="elementor-widget-container">
<h4 class="elementor-heading-title ele
@zorca
zorca / gist:ae5834cdab8f72ab7752592e38f67b75
Created October 18, 2019 18:19 — forked from szydan/gist:75b8a03b3fb4e099d5c1
delete all commits from repo
git checkout --orphan latest_branch && \
git add -A && \
git commit -am "initial commit" && \
git branch -D master && \
git branch -m master && \
git push -f origin master
Taken from
@zorca
zorca / download.php
Created October 28, 2019 07:21 — forked from beyerz/download.php
Symfony console, download remote file with progress bar using guzzle
/**
* @param SymfonyStyle $io
* @param $remotePath
*
* @return string
*/
public function download(SymfonyStyle $io, $remotePath)
{
$io->section("Download " . $remotePath);
$parts = parse_url($remotePath);
@zorca
zorca / functions.php
Created October 28, 2019 09:04 — forked from ericclemmons/functions.php
Auto-activate WordPress Plugins
<?php
// Add to: path/to/wp-content/wp-themes/your-theme/functions.php
/**
* Activate required plugins
*/
include_once ( ABSPATH . 'wp-admin/includes/plugin.php' );
<?php
add_action(
'wp_footer',
function () {
echo wp_kses( $this->debugbar->getJavascriptRenderer()->render(), [ 'script' => [] ] );
},
1000
);