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
/** | |
* BLOCK: Blurb Block | |
* | |
* Registering a basic block with Gutenberg. | |
* Simple block, renders and saves the same content without any interactivity. | |
*/ | |
// Import CSS. | |
import './editor.scss'; | |
import './style.scss'; |
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
backend: | |
name: git-gateway | |
branch: master # Branch to update (optional; defaults to master) | |
media_folder: "src/images" # Media files will be stored in the repo under static/images/uploads | |
collections: | |
- name: "pages" | |
label: "Page" | |
folder: "src/markdown-pages" |
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 { registerBlockType } from '@wordpress/blocks'; | |
import { __ } from '@wordpress/i18n'; | |
import { InspectorControls } from "@wordpress/block-editor"; | |
import { PanelBody, SelectControl } from "@wordpress/components"; | |
registerBlockType( 'create-block/better-latest-posts', { | |
title: __( 'Better Latest Posts', 'create-block' ), | |
description: __( | |
'Example block written with ESNext standard and JSX support – build step required.', |
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
// Set JS for jsonp callback | |
let jsonpID = 0; | |
function jsonp(url, timeout = 7500) { | |
const head = document.querySelector('head'); | |
// set unique identifier for function | |
jsonpID = Math.round(Math.random() * 1000000000); |
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
// cards same height | |
let cards = $('.card'), //get all cards | |
heights = [], //height values array | |
tallest; //tallest card | |
function normalizeHeights() { | |
cards.each(function() { | |
heights.push($(this).height()); | |
}); | |
tallest = Math.max.apply(null, heights); |
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
{ | |
"env": { | |
"browser": true, // Browser global variables like `window` etc. | |
"commonjs": true, // CommonJS global variables and CommonJS scoping.Allows require, exports and module. | |
"es6": true, // Enable all ECMAScript 6 features except for modules. | |
"jest": true, // Jest global variables like `it` etc. | |
"node": true // Defines things like process.env when generating through node | |
}, | |
"extends": [ | |
"plugin:react/recommended", |
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
// shell | |
db.casestudies.find().forEach(function (data) {db.casestudies.update({_id: data._id}, {$set: {links: [],documents: {},}})}); | |
// pretty | |
db.casestudies.find().forEach(function (data) { | |
db.casestudies.update({ | |
_id: data._id | |
}, { | |
$set: { | |
links: [], |
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
export const verifyVideoLinks = async (url) => { | |
const YOUTUBE = process.env.REACT_APP_YOUTUBE_API; | |
url.match( | |
/(http|https?:\/\/)(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(&\S+)?/ | |
); | |
const id = RegExp.$6; | |
console.log("id", id); | |
let embed = null; | |
let verified = false; | |
let video; |
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 | |
namespace App; | |
add_filter('facetwp_facets', function ($facets) { | |
// Register Sort Facet | |
$facets[] = array( | |
"name" => "sort", | |
"label" => "Sort", | |
"type" => "sort", | |
"default_label" => "Sort by", |