Skip to content

Instantly share code, notes, and snippets.

View yuriitaran's full-sized avatar

Yurii Taran yuriitaran

View GitHub Profile
@yuriitaran
yuriitaran / with 'create-react-class' function
Created August 30, 2018 23:39
Creating React Statefull Components
import React from 'react';
import PropTypes from 'prop-types';
// additional packaje for React 15.4+
import createClass from 'create-react-class';
const Checkbox = createClass({
propTypes: {
initiallyChecked: PropTypes.bool.isRequired
},
@yuriitaran
yuriitaran / movies.json
Created August 29, 2018 12:03 — forked from yannski/movies.json
movies.json
[{"id":"4fede17c312f912796000034","cover_url":null,"description":null,"rating":6.3,"title":"L'affaire Gordji, histoire d'une cohabitation"},{"id":"4fede17f312f912796000035","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 1"},{"id":"4fede181312f912796000036","cover_url":null,"description":"Documentary telling the true story of the sinking of the liner Laconia by a German U-boat in 1942 through the eyes of six survivors.","rating":6.8,"title":"Le naufrage du Laconia - partie 2"},{"id":"4fede184312f912796000037","cover_url":"http://ia.media-imdb.com/images/M/MV5BMjAyMTg0MjgwOV5BMl5BanBnXkFtZTcwNTEzODY4Mw@@._V1._SX94_SY140_.jpg","description":"The extraordinary story of three Rwandan kids who walk 3000 miles to the Soccer World Cup in South Africa...","rating":6.2,"title":"Africa United"},{"id":"4fede186312f912796000038","cover_url":"http://ia.
@yuriitaran
yuriitaran / JavaScript fixes & solutions
Last active August 25, 2018 07:34
JavaScript fixes & solutions
Uncaught ReferenceError: regeneratorRuntime is not defined >>> should be installed "regenerator-runtime" plugin
https://www.npmjs.com/package/regenerator-runtime
@yuriitaran
yuriitaran / WP: add attributes to shortcode dynamically
Created July 31, 2018 08:57
WP: add attributes to shortcode dynamically
// Add custom class to Contact Form 7 form
<?php $order_form = '[' . trim($order_form, "[]") . ' html_class="row justify-content-center" ' . ']' ?>
<?php echo do_shortcode($order_form); ?>
@yuriitaran
yuriitaran / Facebook Messenger button integration
Last active July 9, 2018 17:34
Facebook Messenger button integration
<!-- Document body -->
<div class="fb-messengermessageus"
messenger_app_id="{your_app_id}"
page_id="{your_facebook_page_id}"
color="<blue | white>"
size="<standard | large | xlarge>">
>
</div>
<!-- Document Head -->
@yuriitaran
yuriitaran / WP: Contact form 7 tweaks & tricks
Created July 4, 2018 16:09
WP: Contact form 7 tweaks & tricks
// Deregister contact form 7 styles
// function.php
add_action( 'wp_print_styles', 'wps_deregister_styles', 100 );
function wps_deregister_styles() {
wp_deregister_style( 'contact-form-7' );
}
// Remove inputs wrappers
// function.php
@yuriitaran
yuriitaran / Disable to update plugin
Created June 14, 2018 08:56
Disable to update plugin
// functions.php
/* Disable to update ACF Pro */
function my_filter_plugin_updates( $value ) {
if( isset( $value->response['advanced-custom-fields-pro/acf.php'] ) ) {
unset( $value->response['advanced-custom-fields-pro/acf.php'] );
}
return $value;
}
add_filter( 'site_transient_update_plugins', 'my_filter_plugin_updates' );
@yuriitaran
yuriitaran / WP post date
Created June 6, 2018 11:45
WP post date
// 5 months ago
<span class="date"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')).' ago'; ?></span>
// Jan 1, 2018
<span class="date"><?php the_date( 'M j, Y' ); ?> </span>
// More info about date format - https://codex.wordpress.org/Formatting_Date_and_Time
@yuriitaran
yuriitaran / VSCode Editor settings
Last active August 18, 2018 20:38
My VS Code Settings
// Place your key bindings in this file to overwrite the defaults
{
// Controls the font family.
"editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
// Enables font ligatures
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.tabCompletion": true,
"editor.snippetSuggestions": "top",
@yuriitaran
yuriitaran / Prevent default for #-links
Created May 3, 2018 14:24
Prevent default for #-links