Skip to content

Instantly share code, notes, and snippets.

View all4site's full-sized avatar

All4site all4site

View GitHub Profile
// iframe
var youtubePlayer = document.getElementsByClassName('youtube-player')[0];
// play
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
// pause
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
// stop
.shadow-1 {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
}
.shadow-2 {
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}
.shadow-3 {
box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
<?php
/**
* @return array
*/
function fw_my_user_options() {
return array(
'box' => array(
'title' => false,
'type' => 'box',
'options' => array(
add_filter( 'user_contactmethods', 'ved_user_contactmethods' );
function ved_user_contactmethods( $user_contactmethods )
{
$user_contactmethods = null;
$user_contactmethods['phone_number'] = 'Телефон';
return $user_contactmethods;
}
FROM nginx:1.15-alpine
COPY default.conf /etc/nginx/conf.d/default.conf
WORKDIR /app
@all4site
all4site / gulpfile.js
Last active November 7, 2019 17:14
Lessons
var gulp = require('gulp');
var pug = require('gulp-pug');
var browserSync = require('browser-sync');
gulp.task('pug', function () {
gulp.src('app/*.pug')
.pipe(pug({
pretty: true
}))
.pipe(gulp.dest('app'))
@all4site
all4site / print_r
Created April 15, 2019 17:29
print_r
<pre><?php echo print_r (wp_get_post_categories($post->ID, array('fields' => 'all', 'orderby' => 'count'))); ?></pre>
<?php
// template name: news
get_header(); ?>
<section class="doctors">
<div class="wrap">
<div class="doctors__wrap__inner">
<div class="doctors_content">
</div>
</div>
@all4site
all4site / WP_Query
Created April 8, 2019 09:37
Цикл WP для пагинации
<?php
$currentpage = get_query_var( 'paged' );
$postperpage = 3;
$wp_query = new WP_Query( array(
'post_type' => 'news',
'posts_per_page' => $postperpage,
'paged' => $currentpage
));
while ( $wp_query->have_posts() ): $wp_query->the_post(); ?>
@all4site
all4site / atome backup
Last active March 13, 2019 12:35
Atome Backup
1