Skip to content

Instantly share code, notes, and snippets.

View lloc's full-sized avatar
🏠
Working from home

Dennis Ploetner lloc

🏠
Working from home
View GitHub Profile
@lloc
lloc / nginx.conf
Last active August 29, 2015 14:05
...
http {
...
log_format mine '$uri - $blogid : $http_host';
...
}
@lloc
lloc / default
Last active August 29, 2015 14:05
...
server {
...
access_log /var/log/nginx/example-access.log;
access_log /var/log/nginx/example-mine.log mine;
...
}
@lloc
lloc / functions.md
Last active August 29, 2015 14:06
Functions, classes and methods
$obj = new MslsGetSet;
$obj->tmp = 'test';
$val = $obj->get_arr(); // array( 'tmp' => 'test' ) == $val
$val = $obj->has_value( 'tmp' ); // true == $val
$val = $obj->is_empty(); // false == $val
echo $obj->tmp; // Output: test
$obj->reset();
@lloc
lloc / integration.md
Last active August 29, 2015 14:06
Integration, snippets and examples
<?php
function my_enqueue_script() {
if ( is_page() ) {
wp_enqueue_script( 'page', plugins_url( '/js/page.js', __FILE__ ) );
} else {
wp_enqueue_script( 'rest', plugins_url( '/js/rest.js', __FILE__ ) );
}
}
add_action( 'wp_enqueue_scripts', 'my_enqueue_script' );
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@lloc
lloc / available-mail-hooks.php
Last active August 29, 2015 14:14
WordPress Mail Hools
<?php
/**
* Filter the wp_mail() arguments.
*
* @since 2.2.0
*
* @param array $args A compacted array of wp_mail() arguments, including the "to" email,
* subject, message, headers, and attachments values.
*/
@lloc
lloc / .htaccess
Last active August 29, 2015 14:14 — forked from jubstuff/.htaccess
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@lloc
lloc / eaie1.php
Created October 1, 2011 10:51
Extract and Include Example 1
<?php
$template_dir = dirname (__FILE_) . '/templates';
extract ($_REQUEST);
include ($template_dir . '/header.html');
print_r (get_defined_vars ());
include ($template_dir . '/footer.html');
?>