Skip to content

Instantly share code, notes, and snippets.

View mihdan's full-sized avatar
:octocat:
Code is poetry

Mikhail Kobzarev mihdan

:octocat:
Code is poetry
View GitHub Profile
@mihdan
mihdan / contentEditable-placeholder.css
Last active May 31, 2016 10:19 — forked from oswaldoacauan/contentEditable-placeholder.css
CSS - Placeholder support for contentEditable elements
/ *
* Exemple:
* <div contenteditable="true" data-placeholder="Текст заглушки"></div>
*
*/
[contenteditable=true]:empty:before {
content: attr(data-placeholder);
}
@mihdan
mihdan / wp-seo-remove-debugmarker.php
Created June 22, 2016 11:16 — forked from sasankmukkamala/wp-seo-remove-debugmarker.php
Remove WP SEO (Yoast) HTML Comments (Debug Marker).
<?php
function remove_yoastdebugmarker(){
if(defined( 'WPSEO_VERSION' )) {
$wpseo_front = null;
if ( isset( $GLOBALS['wpseo_front'] ) )
$wpseo_front = $GLOBALS['wpseo_front'];
elseif ( class_exists( 'WPSEO_Frontend' ) && method_exists( 'WPSEO_Frontend', 'get_instance' ) )
$wpseo_front = WPSEO_Frontend::get_instance();
remove_action( 'wpseo_head', array($wpseo_front, 'debug_marker') , 2 );
}
@mihdan
mihdan / Sublime Text 3 Build 3103 License Key - CRACK
Created July 8, 2016 21:02
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz
$ tar -xvzf openssl-1.0.2h.tar.gz
$ cd openssl-1.0.2h
$ ./config --prefix=/usr/
$ make depend
@mihdan
mihdan / wp-amp-tutorial-primary-nav.php
Created September 28, 2016 15:08 — forked from johnregan3/wp-amp-tutorial-primary-nav.php
Adding a Primary Navigation Menu to an AMP WordPress Theme
<?php
/**
* Register the amp-sidebar component script with WP AMP.
*
* This goes in your amp.php
*/
function jr3_amp_sidebar_component_script( $data ) {
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
return $data;
}
@mihdan
mihdan / wp-amp-tutorial-menu.php
Created September 28, 2016 15:09 — forked from johnregan3/wp-amp-tutorial-menu.php
Creating a Menu using amp-sidebar in WordPress
<?php
/**
* Render the Primary Nav Menu
*
* Uses amp-sidebar to handle
* slideout animation.
*
* Be sure to include the amp-sidebar component script.
* Also, rememeber that the amp-sidebar element must be
* a direct child of the <body>.
@mihdan
mihdan / wp-amp-tutorial-strip-shortcodes.php
Created September 28, 2016 16:02 — forked from johnregan3/wp-amp-tutorial-strip-shortcodes.php
Strip out all Shortcodes for a WordPress AMP template.
<?php
/**
* Strip out all shortcode content.
*
* This is a quick and dirty way
* to ensure no shortcodes introduce
* invalid markup into an amp template.
*
* @param string $content WP Post content.
*
<?php
/**
* Register the amp-sidebar and amp-accordion component scripts with WP AMP.
*
* This goes in your amp.php
*/
function jr3_amp_component_scripts( $data ) {
$data['amp_component_scripts']['amp-sidebar'] = 'https://cdn.ampproject.org/v0/amp-sidebar-0.1.js';
$data['amp_component_scripts']['amp-accordion'] = 'https://cdn.ampproject.org/v0/amp-accordion-0.1.js';
@mihdan
mihdan / amp-check-for-plugin.php
Created September 28, 2016 16:04 — forked from johnregan3/amp-check-for-plugin.php
Admin notice if the WP AMP Plugin is not installed.
<?php
/**
* Show an Admin Notice if the AMP plugin is not found.
*
* This is a basic implementation. Naturally, you'll want
* to add ajax support so that once this is dismissed, it goes
* away permanently. Also, you may want to limit the admin
* pages this displays to prevent annoying your users.
*
* @return bool
<?php
/**
* Add custom AMP template files.
*
* Registers templates in a /templates subdirectory.
*
* @filter amp_post_template_file
*
* @param string $file The file name input.
* @param string $type The type of template.