Skip to content

Instantly share code, notes, and snippets.

View volodymyrpekh's full-sized avatar

Vlad Pekh volodymyrpekh

View GitHub Profile

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@volodymyrpekh
volodymyrpekh / hidden_comment_form.php
Created June 23, 2017 04:55 — forked from beastaugh/hidden_comment_form.php
Plugin to hide the WordPress comment form until the user clicks a link to reveal it.
<?php
/*
Plugin Name: Hidden Comment Form
Plugin URI: http://tarskitheme.com/help/hooks/example-plugins/
Description: Hide the comment form until the user clicks a link to reveal it.
Author: Benedict Eastaugh
Version: 1.1
Author URI: http://extralogical.net/
*/
@volodymyrpekh
volodymyrpekh / GIF-Screencast-OSX.md
Last active August 30, 2017 03:58 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF | mov to gif

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

# BEGIN WP Rocket v2.10.9
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
</IfModule>
# FileETag None is not enough for every server.
@volodymyrpekh
volodymyrpekh / functions.php
Created September 27, 2017 23:04
Listify JSON-LD - Full version
//To be put in the child theme functions.php
apply_filters( 'listify_get_listing_jsonld', 'my_listify_get_listing_jsonld' );
function my_listify_get_listing_jsonld($markup, $listing) {
$markup = array();
$location_data = $listing->get_location_data();
$markup = array(
'@context' => 'http://schema.org',
@volodymyrpekh
volodymyrpekh / Multipart MIME Email.md
Created June 7, 2019 16:40 — forked from tylermakin/Multipart MIME Email.md
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: sender@example.com
To: recipient@example.com
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"