Type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
Type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
THE RAVEN. | |
Once upon a midnight dreary, while I pondered, weak and weary, | |
Over many a quaint and curious volume of forgotten lore, | |
While I nodded, nearly napping, suddenly there came a tapping, | |
As of some one gently rapping, rapping at my chamber door. | |
"'T is some visiter," I muttered, "tapping at my chamber door-- | |
Only this, and nothing more." |
const range = (start, end, step = 1) => { | |
const forLoop = fn => { | |
for (let x = start; x <= end; x += step) fn(x) | |
} | |
const between = (v, start, end) => v >= start && v <= end | |
const hasValue = v => between(v, start, end) || between(v, end, start) | |
const iterate = function* (mapFn) { | |
for (let x = start; x <= end; x += step) yield mapFn ? mapFn(x) : x |
import { withRouter } from 'next/router'; | |
import Link from 'next/link'; | |
import React, { Children } from 'react'; | |
const ActiveLink = ({ router, children, ...props }) => { | |
const child = Children.only(children); | |
let className = child.props.className || ''; | |
if (router.pathname === props.href && props.activeClassName) { | |
className = `${className} ${props.activeClassName}`.trim(); |
# robots.txt for wordpress | |
# based on https://gist.github.com/chuckreynolds/135728 | |
User-agent: * | |
Disallow: /wp-admin/ | |
Disallow: /cgi-bin/ | |
Disallow: /trackback/ | |
Disallow: /comment-page-* | |
Disallow: /?s=* |
<?php | |
/* | |
Creates and end-point that get Yoast SEO meta tags... | |
*/ | |
add_action('rest_api_init', 'add_yoast_data'); | |
function add_yoast_data() | |
{ | |
// Add your post types here... | |
register_rest_field(array( |
<?php | |
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY | |
$category = get_the_category(); | |
$useCatLink = true; | |
// If post has a category assigned. | |
if ($category){ | |
$category_display = ''; | |
$category_link = ''; | |
if ( class_exists('WPSEO_Primary_Term') ) |
<?php | |
// This is the cleaner code per request of a thread in the LinkedIn group "WordPress" | |
// ... | |
// register and enqueue loadCSS | |
function load_scripts_and_styles() { | |
// register loadCSS | |
wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', false ); |
<?php | |
/* | |
Plugin Name: WP_Rewrite endpoints demo | |
Description: A plugin giving example usage of the WP_Rewrite endpoint API | |
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ | |
Author: Jon Cave | |
Author URI: http://joncave.co.uk/ | |
*/ | |
function makeplugins_endpoints_add_endpoint() { |
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change size for Yoast SEO OpenGraph image for all content | |
* Credit: Yoast Development team | |
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1 | |
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail' | |
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/ | |
*/ | |