Skip to content

Instantly share code, notes, and snippets.

View petrozavodsky's full-sized avatar

Vladimir Petrozavodsky petrozavodsky

View GitHub Profile
@petrozavodsky
petrozavodsky / qtags.php
Created October 15, 2015 08:24 — forked from mattyrob/qtags.php
Quicktags API Test
<?php
/*
Plugin Name: Quicktags API Test
Description: Testing a few different kinds of Quicktags buttons
Author: Kailey Lampert
Author URI: http://kaileylampert.com/
*/
@petrozavodsky
petrozavodsky / wordpress.nginx
Created February 20, 2016 13:00 — forked from LeCoupa/wordpress.nginx
WordPress - Nginx Configuration File (with SSL)
##
# @server studio
# @host hackisition.com
# @desc nginx host rules
# @author Julien Le Coupanec <julien@gentlenode.com>
##
# HTTP Server
server {
listen 80;
@petrozavodsky
petrozavodsky / functions.php
Created October 6, 2016 08:35 — forked from al5dy/functions.php
Yoast SEO - убираем теги <image:image> для Yandex
function yoast_clear_sitemap( $output, $url ) {
$timezone = new WPSEO_Sitemap_Timezone();
$date = null;
if ( ! empty( $url['mod'] ) ) {
$date = $timezone->format_date( $url['mod'] );
}
@petrozavodsky
petrozavodsky / yoast-nulled.php
Created October 28, 2016 07:25 — forked from mihdan/yoast-nulled.php
Занулить yoast-seo-premium
<?php
/**
* 1. В таблице wp_options находим ключ yoast-seo-premium_license или wordpress-seo-premium_license
* и меняем его значение на `a:3:{s:3:"key";s:6:"zalupa";s:6:"status";s:5:"valid";s:11:"expiry_date";s:19:"2970-01-01 00:00:00";}`
*
* 2. Чтобы не слетали все ваши махинации после захода на страницу обновления или проверки лицензии,
* достаточно запретить плагину ломиться по своему АПИ на свой сайт.
* Я это сделал просто: в файле \wordpress-seo-premium\vendor\yoast\license-manager\class-update-manager.php
*/
@petrozavodsky
petrozavodsky / wp-backup.sh
Last active January 15, 2018 18:53 — forked from jdani/wp-backup.sh
Wordpress Backup bash script
#!/usr/bin/env bash
# Exit if any command fails
set -o errexit
# Exit if trying to use undeclared var
set -o nounset
# On piped commands, use the exit status of the last command throwing a non-zero exit code
@petrozavodsky
petrozavodsky / wordpress-plugin-svn-to-git.md
Created January 18, 2018 06:53 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@petrozavodsky
petrozavodsky / manage-etc-hosts.sh
Created August 6, 2018 19:29 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1
@petrozavodsky
petrozavodsky / detect-os.sh
Created August 6, 2018 19:32 — forked from prabirshrestha/detect-os.sh
detect os in bash
#!/bin/sh
UNAME=$(uname)
if [ "$UNAME" == "Linux" ] ; then
echo "Linux"
elif [ "$UNAME" == "Darwin" ] ; then
echo "Darwin"
elif [[ "$UNAME" == CYGWIN* || "$UNAME" == MINGW* ]] ; then
docker cp <dbfile.sql> <container>:/tmp/import.sql
docker exec -it <container> /bin/bash
mysql -u <user> -p <database name> < import.sql
@petrozavodsky
petrozavodsky / git-deployment.md
Created August 13, 2018 16:00 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.