Skip to content

Instantly share code, notes, and snippets.

Florian Brinkmann florianbrinkmann

Block or report user

Report or block florianbrinkmann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
import classnames from 'classnames';
import { textColors, backgroundColors } from '../colors';
const {
registerBlockType,
} = wp.blocks;
const {
InspectorControls,
InnerBlocks,
View index.js
import classnames from 'classnames';
const {
registerBlockType,
} = wp.blocks;
const {
InspectorControls,
InnerBlocks,
withColors,
getColorClass
@florianbrinkmann
florianbrinkmann / functions.php
Created May 2, 2018
Remove lightbox script from Hannover WordPress theme.
View functions.php
<?php
add_action( 'wp_enqueue_scripts', 'hannover_child_remove_lightbox', 100 );
/**
* Remove the Hannover lightbox script.
*/
function hannover_child_remove_lightbox() {
wp_dequeue_script( 'hannover-lightbox' );
wp_deregister_script( 'hannover-lightbox' );
}
@florianbrinkmann
florianbrinkmann / lazy-loader-spinner.css
Last active Feb 22, 2018
Add spinner to images that are currently loaded by lazysizes
View lazy-loader-spinner.css
/* Spinner SVG by Sam Herbert (https://github.com/SamHerbert/SVG-Loaders), published under the MIT License */
.lazyloading {
color: transparent;
opacity: 1;
transition: opacity 300ms;
background: url("data:image/svg+xml,%3Csvg width='44' height='44' xmlns='http://www.w3.org/2000/svg' stroke='%23333'%3E%3Cg fill='none' fill-rule='evenodd' stroke-width='2'%3E%3Ccircle cx='22' cy='22' r='1'%3E%3Canimate attributeName='r' begin='0s' dur='1.8s' values='1; 20' calcMode='spline' keyTimes='0; 1' keySplines='0.165, 0.84, 0.44, 1' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-opacity' begin='0s' dur='1.8s' values='1; 0' calcMode='spline' keyTimes='0; 1' keySplines='0.3, 0.61, 0.355, 1' repeatCount='indefinite'/%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='1'%3E%3Canimate attributeName='r' begin='-0.9s' dur='1.8s' values='1; 20' calcMode='spline' keyTimes='0; 1' keySplines='0.165, 0.84, 0.44, 1' repeatCount='indefinite'/%3E%3Canimate attributeName='stroke-opacity' begin='-0.9s' dur='1.8s' values='1
@florianbrinkmann
florianbrinkmann / style.css
Last active Dec 26, 2017
Child theme stylesheet for rindby theme
View style.css
/*
Theme Name: Rindby Child
Theme URI: https://florianbrinkmann.com/en/wordpress-themes/rindby/
Author: Florian Brinkmann
Description: Child theme for Rindby.
Version: 1.0.0
Template: rindby
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
@florianbrinkmann
florianbrinkmann / custom-tinymce-button.js
Last active Jun 27, 2017
Code to add a custom button to the TinyMCE editor (needs WordPress 4.8)
View custom-tinymce-button.js
/**
* Listen to setup of a TinyMCE instance.
*/
jQuery(document).on('tinymce-editor-setup', function (event, editor) {
/**
* Add the id of the soon-to-create button to the
* toolbar1.
*
* @type {string}
*/
View customize-controls.js
;(function () {
/**
* Run function when customizer is ready.
*/
wp.customize.bind('ready', function () {
wp.customize.control('slug_select_control', function (control) {
/**
* Run function on setting change of control.
*/
control.setting.bind(function (value) {
View utf8-to-utf8mb4.php
<?php
/*
Plugin Name: UTF8mb4-convert
Version: 1.0
*/
function update_db_to_utf8mb4() {
if ( ! isset( $_GET['update-utf8bm4'] ) ) {
return;
}
@florianbrinkmann
florianbrinkmann / dropcap.js
Last active Sep 4, 2018
Modified version of Adobe’s dropcap.js (https://github.com/adobe-webplatform/dropcap.js) to make it responsive
View dropcap.js
/*
Copyright 2014 Adobe Systems Incorporated. Licensed under the Apache 2.0 License.
http://www.apache.org/licenses/LICENSE-2.0.html
*/
(function () {
"use strict";
// Reference terms: http://blogs.wayne.edu/bcam/wp-content/blogs.dir/308/files/2013/09/glyphterms.gif
View noblogredirect.txt
/**
* If registration for new network sites is disabled,
* the NOBLOGREDIRECT constant redirects to a specific URL
* if a user tries to access a nonexisting network site.
*/
// add this to wp-config.php and adjust the URL
define( 'NOBLOGREDIRECT', 'https://example.com' );
/**
You can’t perform that action at this time.