Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <? | |
| if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['insert_post'] )) { //check that our form was submitted | |
| $title = $_POST['thread_title']; //set our title | |
| if ($_POST['thread_description']=="") { // check if a description was entered | |
| $description = "See thread title..."; // if not, use placeholder | |
| } else { | |
| $description = $_POST['thread_description']; //if so, use it |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Building a router</title> | |
| <script> | |
| // Put John's template engine code here... | |
| (function () { | |
| // A hash to store our routes: |
| <?php | |
| function load_js_template(){ | |
| get_template_part( 'sample-template' ); | |
| } | |
| add_action( 'wp_footer', 'load_js_template' ); | |
| function render_template( $template_name, $tmpl_data ) { | |
| // "/" should not be present, but let's sanitize just in case | |
| $template_name = str_replace( '/', '_', $template_name ); |
| // Normalize Carousel Heights - pass in Bootstrap Carousel items. | |
| $.fn.carouselHeights = function() { | |
| var items = $(this), //grab all slides | |
| heights = [], //create empty array to store height values | |
| tallest; //create variable to make note of the tallest slide | |
| var normalizeHeights = function() { | |
| items.each(function() { //add heights to array |
| <?php | |
| /** | |
| * Custom WordImpress RSS2 Feed | |
| * Integrates Featured Image as "Enclosure" | |
| * See http://www.rssboard.org/rss-2-0-1#ltenclosuregtSubelementOfLtitemgt | |
| * for RSS 2.0 specs | |
| * @package WordPress | |
| */ | |
| header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); |
| download curl from http://ftp.sunet.se/pub/www/utilities/curl/curl-7.40.0.tar.bz2 | |
| Configure it with ./configure --prefix=/Applications/MAMP/Library/ | |
| make && make install |
| <?php | |
| /** | |
| * "Friendlier, Safer WordPress Admin Areas" | |
| * Presented by Cliff Seal at WordCamp Atlanta 2015 and Asheville 2016 | |
| * Slides: http://www.slideshare.net/cliffseal/wp-admin | |
| * | |
| * Plugin Name: A Better Admin Experience | |
| * Plugin URI: http://evermoresites.com | |
| * Description: Cleans up and sanitizes the WordPress admin area | |
| * Version: 1.0 |
This is a really basic "todo list" demo built with Mithril.
It's largely an ES6/ES2015 port of the Mithril's Getting Started guide, with a bit of sugar and opinion thrown in to make it look and feel a lot like React.
In this case we're using Babel's JSX transform to convert inline XML into hyperscript (just nested calls to Mithral's m() function).
A Pen by Jason Miller on CodePen.
| <?php | |
| // minimal version | |
| define( 'SHORTINIT', true ); | |
| require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); | |
| // medium version (With lots of overhead) | |
| require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php' ); | |
| // full version (including functions and 200 header) | |
| define( 'SHORTINIT', true ); |