Skip to content

Instantly share code, notes, and snippets.

View lucprincen's full-sized avatar

Luc Princen lucprincen

View GitHub Profile
<?php
namespace YourPlugin\Blocks;
abstract class Block{
/**
* Block title
*
* @var string
@lucprincen
lucprincen / video-in-ratio.scss
Created October 25, 2018 14:57
Scale video in ratio
.wp-block-embed{
position: relative;
.entry-content-asset{
width: 100%;
height: 0;
padding-top: 56.25%;
position: relative;
}
const { __ } = wp.i18n;
const { InnerBlocks } = wp.editor;
const { registerBlockType } = wp.blocks;
registerBlockType(
'kit/container',
{
title: __('Container'),
description: __('Add a container for blocks'),
category: 'common',
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam et tellus risus. Pellentesque finibus augue sed dictum luctus. Donec aliquet nibh bibendum, congue metus porta, interdum odio. Sed tempus sollicitudin augue, vel tristique leo rutrum id. Quisque vitae elementum nunc. Donec sit amet nisi at diam imperdiet consequat. Aenean efficitur magna nec odio vulputate, id porttitor felis blandit</p>
<hr>
<strong>Strong text</strong>
<b>Alternate strong text</b>
<hr>
<i>Italic text</i>
const Twitter = require('twitter');
const config = require('./config.js');
const T = new Twitter(config);
//add week number support:
Date.prototype.getWeekNumber = function(){
var d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()));
var dayNum = d.getUTCDay() || 7;
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));
const $ = require('jquery');
class RadioTabs {
constructor($component) {
this.$component = $component;
this.attachEventHandlers();
this.selectTabBasedOnRadioValue();
}
/** Sections: **/
add_filter( 'chef_sections_column_template_base', function(){
return 'elements/columns/';
});
add_filter( 'chef_sections_block_template_base', function(){
return 'elements/block/';
});
add_filter( 'chef_sections_section_template_base', function(){
//IE9 flexbox grid fixes:
.no-flexbox, .no-flexboxlegacy{
.column-row{
&.half-half .column{
@include span-columns( 6 );
}
&.sidebar-left .column, &.sidebar-right .column{
@include span-columns( 8 );
John Hughes:
Breakfast Club
Ferris buellers day off
weird science
planes trains & automobiles
Quintin Tarantino (two weeks)
flex-flow:column-reverse wrap-reverse;
justify-content:center;
align-content:space-between;