Skip to content

Instantly share code, notes, and snippets.

@lkwdwrd
lkwdwrd / comments-templates.php
Last active September 15, 2021 15:15
Ajax Comment Fun with WordPress JS Helpers
<?php // Templates for ajax comments ?>
<?php /* Wrap for comments in general should none be present */ ?>
<script type="text/html" id="tmpl-comment-wrap">
<div class="comments">
<h2 class="comments-title">Comments</h2>
<ol class="commentlist"></ol>
</div>
</script>
@lkwdwrd
lkwdwrd / keybase.md
Created February 13, 2018 23:47
keybase.md

Keybase proof

I hereby claim:

  • I am lkwdwrd on github.
  • I am lkwdwrd (https://keybase.io/lkwdwrd) on keybase.
  • I have a public key ASD2LrfdNkrbG0xTVdbHFu8zejkexhHw1RS6erpucEwHAQo

To claim this, I am signing this object:

@lkwdwrd
lkwdwrd / Customfile
Created September 15, 2015 02:20
VVV Customfile for Hyper-V compatibility
# Hyper-V only overrides
config.vm.provider :hyperv do |v, override|
# Update memory and CPUs to match VVV config.
v.memory = 1024
v.cpus = 1
# Use a Hyper-V compatible base box
override.vm.box = "ericmann/trusty64
# Change all the folder to use SMB instead of Virtual Box shares
@lkwdwrd
lkwdwrd / WPMakeV1.md
Created August 28, 2016 04:22
WP Make Version 1

WP Make Version 1

WP Make has been a very useful tool, but has suffered many small problems over the last several years. To that end, WP Make has been re-imagined in a way to try and deal with many of the pain points it has had to-date.

WP Make has been in a sub-one-point-oh state since its inception. This was intentional, as it was intended originally to be a port of the original grunt-init plugin and theme scripts, moved over to Yeoman in as quick a way possible. With 1.0, we will take what we learned from this hodgepodge of scripts and apply it to creating a smooth, flexible, and maintainable generator to help us bootstrap our work more quickly.

Architecture

The heart of the 1.0 changes is a major architecture shift. Where before WP Make was the most basic of Yeoman generators, now it will come into it's own with an architecture that makes input and output much more declarative and flexible.

@lkwdwrd
lkwdwrd / keybase.md
Created May 9, 2016 03:28
keybase.md

Keybase proof

I hereby claim:

  • I am lkwdwrd on github.
  • I am lkwdwrd (https://keybase.io/lkwdwrd) on keybase.
  • I have a public key ASAlBozXC9BRzYcmALE1e1GJylOIEIVZIGjiGUc_F9Eq7go

To claim this, I am signing this object:

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
env RMT_PORT_9000_TCP_ADDR;
@lkwdwrd
lkwdwrd / class-reflector-decorator.php
Created January 4, 2016 00:33
Reflector Decorator Play
<?php
namespace WP_Parser\Reflection;
use WP_Parser\Reflection\Reflector_Meta;
final class Reflector_Decorator {
use Reflector_Meta;
private $_reflector;
@lkwdwrd
lkwdwrd / class-doc-block-factory.php
Created January 4, 2016 00:17
Docblock Factory Play
<?php
namespace WP_Parser\Reflection;
use WP_Parser\Reflection\Doc_Block;
use phpDocumentor\Reflection\Location;
use phpDocumentor\Reflection\DocBlockFactory;
use phpDocumentor\Reflection\DocBlockFactoryInterface;
use phpDocumentor\Reflection\Types\Context;
final class Doc_Block_Factory implements DocBlockFactoryInterface {
@lkwdwrd
lkwdwrd / closer.js
Created October 23, 2013 18:24
// close something on document click
// Non jQuery
function closeSomething( event ) {
var id = 'ID-of-container';
function traverseDOM( el ) {
if ( null === el.parentNode ) {
return true;
} else if ( id === el.id ) {
return false;
} else {
return traverseDOM( el.parentNode );
@lkwdwrd
lkwdwrd / gist:6759447
Created September 30, 2013 04:41
Add post title to bodyclass
<?php
function eg_title_bodyclass( $classes ) {
$classes[] = sanitize_html_class( get_the_title() );
return $classes;
}
add_filter( 'body_class', 'eg_title_bodyclass' );