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 | |
add_filter('wp_redirect', 'clarify_redirect'); | |
function clarify_redirect( $url ) { | |
$callers = debug_backtrace(); | |
foreach ($callers as $i => $caller) { | |
header("X-Caller-{$i}: ". $caller['function']); | |
} | |
return $url; | |
} |
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
#!/bin/bash | |
SVN=/usr/local/bin/svn | |
[ ! -f "$SVN" ] && SVN=/usr/bin/svn | |
trunk_or_branch_status () { | |
echo "Status on SVN ($1)" | |
TRUNKREV=` svn info "$1" | grep "Last Changed Rev" | egrep -o [0-9]+ ` | |
TAGSREV=` svn info "$2"/tags | grep "Last Changed Rev" | egrep -o [0-9]+ ` | |
[ $TRUNKREV -gt $TAGSREV ] && echo There are changes not yet tagged \! \( HEAD: $TRUNKREV, Tags: $TAGSREV \) && svn log -r $TAGSREV:$TRUNKREV | |
[ $TRUNKREV -le $TAGSREV ] && echo No action needed\! |
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(t,r,a,c,k,i,n,g) { | |
if (c === n.test(g)) return; | |
t[r]=t[r]||function(){(t[r].q=t[r].q||[]).push(arguments); if (arguments[0] == i) { t[r]("set", k, c); }}; | |
t[a]=t[a]||t[r]; | |
})( window, 'ga', '__gaTracker', !0, 'anonymizeIp', 'create', /eucookieconsent=1/, document.cookie ); |
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 (s) { | |
s.toAscii = function () { | |
var diacritics = [ | |
{'base':'A', 'letters':/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g}, | |
{'base':'AA','letters':/[\uA732]/g}, | |
{'base':'AE','letters':/[\u00C6\u01FC\u01E2]/g}, | |
{'base':'AO','letters':/[\uA734]/g}, | |
{'base':'AU','letters':/[\uA736]/g}, | |
{'base':'AV','letters':/[\uA738\uA73A]/g}, |
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 | |
/* | |
Open Source Autodiscover implementation in PHP. | |
Version: 1.0 | |
Tested with: | |
- Microsoft Exchange Remote Connectivity Analyzer (1.3) | |
- iOS 4.3.5 | |
- Outlook 2010 (SP0) | |
- Android 2.3.3 |
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 | |
add_filter('cron_schedules', function( $schedules ) { | |
$schedules['quarterly'] = array( | |
"interval" => HOUR_IN_SECONDS/4, | |
"display" => "Every 15 minutes" | |
); | |
return $schedules; | |
}); |
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
if (!Number.prototype.format) { | |
Number.prototype.format = function(decimals, decimal_separator, thousands_separator, prefix, suffix) { | |
decimals = decimals || 0; | |
decimal_separator = decimal_separator || ','; | |
thousands_separator = thousands_separator || '.'; | |
prefix = prefix || ""; | |
suffix = suffix || ""; | |
var str = this.toFixed(decimals).toString().split('.'); | |
var parts = []; |
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
#!/bin/bash | |
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2"@example.com>"}' | sort -u > users.txt |
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(w) { | |
w.cantel = true; // set true for all browsers | |
if ("ActiveXObject" in w) { // if IE <= 11 | |
w.cantel = false; | |
var activex; | |
try { activex = !!new ActiveXObject("Skype.Detection"); } catch (e) { activex = false; }; // test for skype | |
if (activex) { | |
w.cantel = true; | |
} | |
} |
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 | |
/** | |
* @class Returns a list of DUTCH holidays on which we brave people stop and do nothing for a day... just 'cause :) | |
*/ | |
class Holidays { | |
/** | |
* Returns all dates on which we Dutch people get a day off of work. | |
* @param int $year The year for which to get the list of holidays | |
* @return Array The list of holidays, associative array [holiday name] => [date in d-m-Y format] | |
*/ |
OlderNewer