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 | |
/** | |
* Given a URL, normalize that URL. | |
* @param String URL | |
* @return String Normalized URL | |
*/ | |
function normalizeUrl($url) | |
{ | |
$newUrl = ""; | |
$url = parse_url($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
<?php | |
array( | |
'abet', | |
'abut', | |
'ache', | |
'alit', | |
'ante', | |
'arch', | |
'aver', | |
'avow', |
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 | |
/** | |
* Debugging output like a boss: automatically print_r the content of any arguments, | |
* and print those contents + the stack trace to the error log. | |
* @param As many params as you want, type is irrelevant | |
*/ | |
function error_logr(/* whatever you want */) { | |
$args = func_get_args(); | |
$message = !empty($args[0]) && is_string($args[0]) ? array_shift($args[0]) : null; | |
$e = new Exception($message); |
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
{ | |
"data": [ | |
{ | |
"id": "10101060157562796", | |
"from": { | |
"name": "Aaron Collegeman", | |
"id": "25515241" | |
}, | |
"start_time": "2013-04-03T03:39:10+0000", | |
"end_time": "2013-04-03T03:39:10+0000", |
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 | |
// don't show Facebook Comments on Pages | |
add_filter('fbc_disable_on_pages', '__return_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
// step 1: Open Google Analytics to Traffic Sources => Sources => Search => Organic | |
// step 2: Change "Show rows" field to 500 | |
// step 3: Open the JS console, and run the following script | |
var s = document.createElement('script'); s.src = '//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'; document.getElementsByTagName('body')[0].appendChild(s); | |
var text = jQuery('td.sf span').map(function(i, el) { return jQuery(el).text(); }); | |
// step 4: Then run this one: | |
var words = {}; |
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 | |
/** | |
* Resize images dynamically using wp built in functions. | |
* @author Victor Teixeira http://profiles.wordpress.org/vteixeira/ | |
* @author Aaron Collegeman http://aaroncollegeman.com | |
* @see http://core.trac.wordpress.org/ticket/15311 | |
* | |
* php 5.2+ | |
* | |
* Examples: |
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 | |
/* | |
@author Corey Brown https://github.com/coreyweb | |
This code will display the 10 most commented on posts. | |
Rules: | |
- published within the last month | |
- at least one comment made in the last week |
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 python | |
# | |
# webkit2png.py | |
# | |
# Creates screenshots of webpages using by QtWebkit. | |
# | |
# Copyright (c) 2008 Roland Tapken <roland@dau-sicher.de> | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License |