Skip to content

Instantly share code, notes, and snippets.

@mikeschinkel
mikeschinkel / virtual-posts.php
Last active December 11, 2017 21:49
Proof of concept showing how to implement virtual posts in WordPress but requires `make_post_instance` hook (or similar) to exist. See: https://core.trac.wordpress.org/ticket/12955#comment:24
<?php
/**
* Plugin Name: Virtual Posts
*
* @see https://github.com/usagov/Federal-Agency-Directory-API-Documentation
*/
class Virtual_Posts {
const POST_TYPE = 'vp_fed_mob_apps';
@madeingnecca
madeingnecca / gist:4160553
Last active July 14, 2017 00:48
BASH utils
#!/bin/bash
# Cleans directory from cvs dir/files.
# http://snippets.dzone.com/posts/show/934
find "$1" -name 'CVS' -exec rm -rf '{}' \; -print
# Generate fake file with a specific size (useful for uploads)
head -c 3000000 /dev/urandom > upload_test_3MB.zip
# Extracts count per page name in an access_log Apache file