This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @import "../node_modules/bulma/sass/utilities/initial-variables" | |
| // custom overrides and general styles | |
| @import "./general/style.sass" | |
| @import "./mymodule/style.sass" | |
| // | |
| @import "../node_modules/bulma/bulma" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // License: GPLv2+ | |
| var el = wp.element.createElement, | |
| registerBlockType = wp.blocks.registerBlockType, | |
| ServerSideRender = wp.components.ServerSideRender, | |
| TextControl = wp.components.TextControl, | |
| InspectorControls = wp.editor.InspectorControls; | |
| /* | |
| * Here's where we register the block in JavaScript. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function logger(strings,...values) { | |
| var str = ""; | |
| for (let i = 0; i < strings.length; i++) { | |
| if (i > 0) { | |
| if (values[i-1] && typeof values[i-1] == "object") { | |
| if (values[i-1] instanceof Error) { | |
| if (values[i-1].stack) { | |
| str += values[i-1].stack; | |
| continue; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function (context, trackingId, options) { | |
| const history = context.history; | |
| const doc = document; | |
| const nav = navigator || {}; | |
| const storage = localStorage; | |
| const encode = encodeURIComponent; | |
| const pushState = history.pushState; | |
| const typeException = 'exception'; | |
| const generateId = () => Math.random().toString(36); | |
| const getId = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Enable dev mode vendor packages. | |
| */ | |
| if ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) { | |
| return; | |
| } | |
| add_action( 'init', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // this snippet requires PHP 5.3+ | |
| add_action( 'wp_enqueue_scripts', function() { | |
| wp_register_style( 'atomic-blocks/ab-cta', '/path/to/atomic-blocks/css/ab-cta.css', array(), 1.0.0 ); | |
| } ); | |
| add_filter( 'render_block', function( $block_content, $block ) { | |
| if ( 'atomic-blocks/ab-cta' === $block['blockName'] ) { | |
| ob_start(); | |
| wp_print_styles( $block['blockName'] ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Include all non-core taxonomies in the sync request, limiting by publicly queryable. | |
| * | |
| * @param array The list of existing taxonomies. | |
| * @return array The new array list. | |
| */ | |
| function sync_non_core_taxonomies( $taxonomies ) { | |
| $taxes = get_taxonomies(); | |
| foreach ( $taxes as $taxonomy ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const assert = require('assert'); | |
| //========== Helper functions | |
| /** | |
| * Resolves after `ms` milliseconds | |
| */ | |
| function delay(ms) { | |
| return new Promise((resolve, _reject) => { | |
| setTimeout(resolve, ms); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Block helpers | |
| * add special classes when certain blocks appear, put this in your functions.php file or include it somewhere | |
| */ | |
| // add block classes in body and post class | |
| function blocks_body_class( $classes ) { | |
| global $post; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copy this into the console of any web page that is interactive and doesn't | |
| do hard reloads. You will hear your DOM changes as different pitches of | |
| audio. | |
| I have found this interesting for debugging, but also fun to hear web pages | |
| render like UIs do in movies. | |
| */ | |
| const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |