Because Chrome DevTools snippets don't get saved...boo
also, for good reference: http://anti-code.com/devtools-cheatsheet/
<?php | |
/* | |
Plugin Name: Dev Debug Me | |
Plugin URI: https://codex.wordpress.org/Debugging_in_WordPress | |
Description: Just some developer includes for debugging. Not actually a plugin; activate to test log writing. | |
Author: zaus | |
Version: 0.1 | |
Author URI: https://gist.github.com/zaus/35c1deb8ead5baa6fc40 | |
*/ |
Because Chrome DevTools snippets don't get saved...boo
also, for good reference: http://anti-code.com/devtools-cheatsheet/
[Default Text] | |
FileNameExtensions=txt; text; wtx; log; asc; doc | |
Default Style=font:DejaVu Sans Mono; size:10; fore:#F8F8F2; back:#000000 | |
Margins and Line Numbers=size:-2; fore:#BCBCBC; back:#3B3A32 | |
Matching Braces=size:+1; bold; fore:#000000; back:#FD971F | |
Matching Braces Error=size:+1; bold; fore:#F8F8F0; back:#F92672 | |
Control Characters (Font)=size:-1 | |
Indentation Guide (Color)=fore:#A0A0A0 | |
Selected Text (Colors)=fore:#F8F8F2; back:#49483E; eolfilled | |
Whitespace (Colors, Size 0-5)=fore:#AA2B00 |
switch($_SERVER['HTTP_HOST']) { | |
case 'wp.sandbox:81': | |
define('DB_NAME', 'YOURDB');/** The name of the database for WordPress */ | |
define('DB_USER', 'YOURUSER');/** MySQL database username */ | |
define('DB_PASSWORD', 'YOURPASS');/** MySQL database password */ | |
define('DB_HOST', 'localhost');/** MySQL hostname */ // may need to use actual computer ip in some cases | |
break; | |
default: | |
define('DB_NAME', 'YOURDB');/** The name of the database for WordPress */ | |
define('DB_USER', 'YOURUSER');/** MySQL database username */ |
void Main() | |
{ | |
// https://stackoverflow.com/questions/150750/hashset-vs-list-performance/13089134?noredirect=1#comment76605526_13089134 | |
test(10, 5, 10, true); | |
test(20); | |
test(50); | |
test(100); | |
test(1000); | |
$.fn.stripClass = function (partialMatch, endOrBegin) { | |
/// <summary> | |
/// The way removeClass should have been implemented -- accepts a partialMatch (like "btn-") to search on and remove | |
/// </summary> | |
/// <param name="partialMatch">the class partial to match against, like "btn-" to match "btn-danger btn-active" but not "btn"</param> | |
/// <param name="endOrBegin">omit for beginning match; provide a 'truthy' value to only find classes ending with match</param> | |
/// <returns type=""></returns> | |
var x = new RegExp((!endOrBegin ? "\\b" : "\\S+") + partialMatch + "\\S*", 'g'); | |
// http://stackoverflow.com/a/2644364/1037948 |
/// <summary> | |
/// PGP round-trip encryption -- http://blogs.microsoft.co.il/kim/2009/01/23/pgp-zip-encrypted-files-with-c/#comment-611002 | |
/// </summary> | |
public class PGPEncryptDecrypt | |
{ | |
/** | |
* A simple routine that opens a key ring file and loads the first available key suitable for | |
* encryption. | |
* | |
* @param in |
public static class HtmlRenderExtensions { | |
/// <summary> | |
/// Delegate script/resource/etc injection until the end of the page | |
/// <para>@via http://stackoverflow.com/a/14127332/1037948 and http://jadnb.wordpress.com/2011/02/16/rendering-scripts-from-partial-views-at-the-end-in-mvc/ </para> | |
/// </summary> | |
private class DelayedInjectionBlock : IDisposable { | |
/// <summary> | |
/// Unique internal storage key | |
/// </summary> |
using System.IO; | |
using Microsoft.Ajax.Utilities; | |
/// <summary> | |
/// Minify javascript files with externally overridable configuration settings. | |
/// </summary> | |
public class ConfigurableJsMinify : StandardFileBundleTransform { | |
protected bool includeFilenamesInOutput; |
<?php | |
if(!class_exists('WpPluginUpgradeBase')) : | |
abstract class WpPluginUpgradeBase { | |
function __construct() { | |
add_action( 'admin_init', array(&$this, 'load_plugin') ); | |
} |