This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PrintTrace() { | |
$trace = debug_backtrace(); | |
echo '<pre>'; | |
$sb = array(); | |
foreach($trace as $item) { | |
if(isset($item['file'])) { | |
$sb[] = htmlspecialchars("$item[file]:$item[line]"); | |
} else { | |
$sb[] = htmlspecialchars("$item[class]:$item[function]"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// How many revisions should be created? | |
$num_of_revisions = 900; | |
// Demo content | |
$content = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. | |
Lorem ipsum dolor sit amet, minim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# The MIT License (MIT) | |
# Copyright (c) 2013 Mark Jaquith | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Use only code below | |
/** | |
* Use shortcode_atts_gallery filter to add new defaults to the WordPress gallery shortcode. | |
* New gallery shortcode defaults (columns="2" and size="medium"). | |
* Allows user input in the post gallery shortcode. | |
* | |
* @author Marcy Diaz | |
* @link http://amethystwebsitedesign.com/how-to-use-larger-images-in-a-wordpress-gallery/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Force Strict OFF | |
* Description: Forces Strict errors off | |
* Author: John P. Bloch | |
* Version: 0.1 | |
* License: GPLv2 | |
*/ | |
if ( WP_DEBUG ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'tiny_mce_before_init', 'my_mce_init', 20 ); | |
function my_mce_init( $init ) { | |
if ( current_user_can('unfiltered_html') ) { | |
if ( ! empty( $init['extended_valid_elements'] ) ) { | |
$init['extended_valid_elements'] .= ','; | |
} else { | |
$init['extended_valid_elements'] = ''; | |
} | |
$init['extended_valid_elements'] .= 'img[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|contextmenu|draggable|dropzone|hidden|spellcheck|translate|src|alt=|usemap|ismap|width|height|name|longdesc|align|border|hspace|vspace|crossorigin|onclick|ondblclick|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseover|onmouseout|onmouseup|onkeydown|onkeypress|onkeyup]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function set_attribute( element, setFrom, setTo ) { | |
var val = element.val(); | |
from = 'type=\"' + setFrom + '\"', | |
to = 'type=\"' + setTo + '\"'; | |
// Workaround for element.attr('type', 'password'); doesn't work in ie8 | |
element | |
.replaceWith( | |
element = $( element.wrap( '<label></label>' ) | |
.parent('label') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uuid = require('node-uuid'), // npm install node-uuid | |
crypto = require('crypto'); | |
var UUID_NUM = 1000000; | |
var uuid_table = {}; | |
OlderNewer