Skip to content

Instantly share code, notes, and snippets.

View volodymyrpekh's full-sized avatar

Vlad Pekh volodymyrpekh

View GitHub Profile
@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"
@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',
# 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 / 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:

@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/
*/

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!
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button_1", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
return "<button class='button' id='gform_submit_button_{$form["id"]}'><span><i class='fa fa-share fa-2x'></i> Send </span></button>";
}
//Change hook of gform_submit_button_X to the form that you are using
//Change <span><i class='fa fa-share fa-2x'></i> Send </span> to Font awesome and text of your choice
@volodymyrpekh
volodymyrpekh / footer.php
Created January 11, 2017 05:51 — forked from rali14/footer.php
Enable footer on the Job Listings Archive (Listify)
@volodymyrpekh
volodymyrpekh / footer.php
Created January 11, 2017 05:49 — forked from rali14/footer.php
Hide CTA for logged in users
@volodymyrpekh
volodymyrpekh / functions.php
Created January 11, 2017 05:38 — forked from rali14/functions.php
Set default cover image for all listings
function custom_default_listify_cover_image( $image, $args ) {
global $post;
if ( $post->post_type == 'job_listing' ) {
return ""; //You can add URL to a default image here or leave it blank if you do not want a background for listings
}
}
add_filter( 'listify_cover_image', 'custom_default_listify_cover_image', 10, 2 );