Skip to content

Instantly share code, notes, and snippets.

View ihorvorotnov's full-sized avatar
🇺🇦
Working remotely since 1999

Ihor Vorotnov ihorvorotnov

🇺🇦
Working remotely since 1999
View GitHub Profile
# Create a repository archive
# Format: git archive {branchname} --format={compression} --output={filename}
git archive master --format=tar --output=kuma.tar
git archive some-feature-branch --format=tar --output=kuma.tar
@ihorvorotnov
ihorvorotnov / full-image-quality.php
Last active September 20, 2015 20:51 — forked from raewrites/full-image-quality.php
Full Image Quality
add_filter( 'jpeg_quality', create_function( '', 'return 100;' ) );
@ihorvorotnov
ihorvorotnov / .gitconfig
Last active September 20, 2015 14:04 — forked from shawndumas/.gitconfig
Using WinMerge as the git Diff/Merge Tool on Windows 64bit
[mergetool]
prompt = false
keepBackup = false
keepTemporaries = false
[merge]
tool = winmerge
[mergetool "winmerge"]
name = WinMerge
@ihorvorotnov
ihorvorotnov / index.html
Last active August 29, 2015 22:42 — forked from benschwarz/index.html
Using ARIA roles with <header>, <footer> and <aside>
<!doctype html>
<html>
<body>
<header role="banner">
<a href="/" rel="home">My company</a>
<nav role="navigation">
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
/**
* Get post thumbnail url
*/
function get_image_url(){
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src( $image_id, 'full', false );
$image_url = $image_url[0];
echo $image_url;
<?php
add_action('gform_after_submission', 'gfToAcfListToRepeater', 10, 2);
function gfToAcfListToRepeater($entry, $form)
{
foreach ($form['fields'] as $field) {
if (!($field['type'] == 'post_custom_field' && $field['inputType'] == 'list' && $field['enableColumns'] == true)) {
continue;
}
$id = $field['id'];
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@ihorvorotnov
ihorvorotnov / .editorconfig
Created May 25, 2015 23:30
WordPress Core .editorconfig
# 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
<?php # -*- coding: utf-8 -*-
declare( encoding = 'UTF-8' );
/**
* Plugin Name: Defer Contact Form 7 Scripts
* Description: Adds <code>defer='defer'</code> to enqueued javascripts.
* Version: 1.0
* Required: 3.3
* Author: Thomas Scholz
* Author URI: http://toscho.de
* License: GPL
@ihorvorotnov
ihorvorotnov / mobile_tablet.php
Created May 8, 2015 15:34
Custom function to separate phones and tablets with wp_is_mobile() function
<?php
/**
* It's just an example, proof of concept.
* You should modify it to include more tablets, not only iPad.
*/
function my_wp_is_mobile() {
static $is_mobile;
if ( isset($is_mobile) )