Skip to content

Instantly share code, notes, and snippets.

View w33zy's full-sized avatar

Kemory Grubb w33zy

  • 09:06 (UTC -04:00)
View GitHub Profile
@w33zy
w33zy / wordpress_export_to_json.php
Created October 8, 2020 18:48 — forked from jsnelders/wordpress_export_to_json.php
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@w33zy
w33zy / shortcode.php
Created January 14, 2020 19:10
shortcode
<?php
function callout_shortcode( $atts ) {
$out = '';
$atts = shortcode_atts(
array(
'callout_h4' => 'This is a header',
'callout_p' => 'This is the paragraph below it',
),
$atts
<?php
/**
* The Template for displaying content of post format standard
*
* @author tokoo
* @version 2.0
* @file wp-content/themes/pustaka-child/template-parts/content.php
*/
<?php
namespace App\Services;
use Ratchet\Http\HttpServer;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;
use Ratchet\Server\IoServer;
use Ratchet\WebSocket\WsServer;
class RatchetServer implements MessageComponentInterface
<?php
function generate_json_ld() {
if ( ! is_single() ) {
return null;
}
$data = [];
@w33zy
w33zy / ID.js
Created August 22, 2019 12:19
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
<div id="currently-reading">
<currently-reading></currently-reading>
</div>
<template id="reading-template">
<div id="rcno-currently-reading">
<div class="rcno-currently-reading-widget-fe">
<div class="book-cover" title="89% completed">
<div class="progress-bar-container">
<img src="/src/book-cover.jpg" alt="book-cover" />
@w33zy
w33zy / php-block.js
Created August 6, 2018 02:05 — forked from pento/php-block.js
Converting a shortcode to a block
// 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.
@w33zy
w33zy / cat-like-custom-taxonomy.php
Created January 7, 2018 16:11 — forked from gschoppe/cat-like-custom-taxonomy.php
Use category (checkbox-based) interface with non-hierarchical custom taxonomies
<?php
// Event taxonomies
add_action( 'init', function() {
$labels = array(
'name' => _x( 'Terms', 'taxonomy general name' ),
'singular_name' => _x( 'Term', 'taxonomy singular name' ),
);
register_taxonomy( 'taxonomy_name', array( 'post' ), array(
'hierarchical' => false,
@w33zy
w33zy / php7.1.md
Last active May 28, 2018 01:32 — forked from VirtuBox/php7.1.md
How to install php7.1-fpm with EasyEngine

How to install php7.2-fpm with EasyEngine


Install php7.2-fpm

apt install php7.2-common php7.2-cli php7.2-zip php7.2-opcache php7.2-mysql php7.2-mcrypt php7.2-mbstring php7.2-json php7.2-intl php7.2-gd php7.2-fpm php7.2-curl php7.2-bz2

Copy the php7.2-fpm pool configuration from php7.0-fpm

cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.2/fpm/pool.d/www.conf