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 | |
function svg_tree_func($atts, $json = null) { | |
static $counter = 0; | |
$counter++; | |
extract(shortcode_atts(array( | |
// additional options can go here | |
), $atts)); | |
$data = json_decode($json); |
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/env perl | |
# Author: Weston Ruter @ X-Team <http://weston.ruter.net/> | |
use strict; | |
if(@ARGV < 2){ | |
die "Usage: ./list-paths-from-svn-revs.pl URL REV [REV...]\n"; | |
} | |
my $repo_url = shift @ARGV; |
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
// ==UserScript== | |
// @name MouseWheel-scrollable Text Inputs | |
// @description Enable horizontally scrollable text inputs via mousewheel, to make Chrome behave like Firefox. | |
// @include * | |
// @namespace http://weston.ruter.net/ | |
// ==/UserScript== | |
document.addEventListener('mousewheel', function(e){ | |
var target = e.target; | |
if(target.nodeName.toLowerCase() == 'input'){ |
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
// ==UserScript== | |
// @name Remove autocomplete=off | |
// @description Decide for yourself whether or not you want the browser to remember login credentials. | |
// @namespace http://weston.ruter.net/ | |
// @match * | |
// ==/UserScript== | |
Array.prototype.forEach.call(document.querySelectorAll('[autocomplete]'), function(el){ | |
el.setAttribute('autocomplete', 'on'); | |
}); |
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
// ==UserScript== | |
// @name Media Fragments for Media Elements | |
// @description Adds support for Media Fragment time offsets (e.g. #t=20) to standalone HTML5 media elements (i.e. audio, video); allows you to bookmark time indexes by in media (via pausing) and then navigate between them with browser navigation. | |
// @namespace http://weston.ruter.net/ | |
// @include * | |
// ==/UserScript== | |
/** | |
* Issues or potential issues: | |
* - If currentTime gets set too soon (before media initializes) does an error occur? |
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
Index: wp-content/themes/twentyten/functions.php | |
=================================================================== | |
--- wp-content/themes/twentyten/functions.php (revision 16586) | |
+++ wp-content/themes/twentyten/functions.php (working copy) | |
@@ -39,6 +39,32 @@ | |
*/ | |
/** | |
+ * Allow each theme to serve their own favicon (e.g. for multisite WordPress) | |
+ */ |
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 | |
/** | |
* Edge Side Includes (ESI) Shortcode | |
*/ | |
function esi_shortcode($attrs){ | |
$attrs = shortcode_atts(array( | |
'src' => '', | |
'ttl' => '1h', | |
'dca' => 'none', |
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 | |
define('ARRAY_CACHE_FILE', dirname(__FILE__) . '/array-cache.txt'); | |
function get_array(){ | |
if( time() - filemtime(ARRAY_CACHE_FILE) < 3600 ){ | |
return unserialize( file_get_contents(ARRAY_CACHE_FILE) ); | |
} | |
$array = generate_array(); // ... | |
file_put_contents( ARRAY_CACHE_FILE, serialize(array) ); |
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
@@ -28,7 +28,7 @@ | |
### Set diff-cmd to the absolute path of your 'diff' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff implementation. | |
-# diff-cmd = diff_program (diff, gdiff, etc.) | |
+diff-cmd = colordiff | |
### Set diff3-cmd to the absolute path of your 'diff3' program. | |
### This will override the compile-time default, which is to use | |
### Subversion's internal diff3 implementation. |