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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = 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
// History.js It! | |
// v1.0.1 - 30 September, 2012 | |
// https://gist.github.com/854622 | |
(function(window,undefined){ | |
// Prepare our Variables | |
var | |
History = window.History, | |
$ = window.jQuery, | |
document = window.document; |
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
import os | |
import sys | |
def getroot(): | |
# If the length of 'sys.argv' is longer than one, index 1 is assumed to be | |
# root. | |
if len(sys.argv) == 1: | |
path = '' | |
else: | |
path = sys.argv[1] |
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 | |
# -*- mode: python; coding: utf-8-unix -*- | |
import sys | |
import os.path | |
import smtplib | |
if len(sys.argv) <= 2: | |
print('Usage:') | |
print(' $ python ' + sys.argv[0] + ' mailfrom rcptto <emlfile>') | |
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_action( 'init', 'ap_reset_featured_images' ); | |
function ap_reset_featured_images() { | |
if ( !is_user_logged_in() ) return; | |
if ( isset( $_GET['reset-featured-image'] ) && true == $_GET['reset-featured-image'] ) { | |
$allposts = get_posts( array( 'posts_per_page' => 9999 ) ); |
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
<config> | |
<parm name="COL_LIMIT" value="int(79)" /> | |
<parm name="SHEBANG" value="" /> | |
<parm name="PARENTHESIZE_TUPLE_DISPLAY" value="bool(False)" /> | |
<parm name="ADD_BLANK_LINES_AROUND_COMMENTS" value="bool(False)" /> | |
<parm name="ADD_BLANK_LINE_AFTER_DOC_STRING" value="bool(False)" /> | |
<parm name="MAX_SEPS_FUNC_DEF" value="int(99)" /> | |
<parm name="MAX_SEPS_FUNC_REF" value="int(99)" /> | |
<parm name="WRAP_DOC_STRINGS" value="bool(True)" /> | |
<parm name="NORMALIZE_DOC_STRINGS" value="bool(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
((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d)) |
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
# Ref from http://stackoverflow.com/questions/2361945/detecting-consecutive-integers-in-a-list | |
from itertools import groupby | |
from operator import itemgetter | |
class PageRange(object): | |
@staticmethod | |
def to_text_range(array_of_numbers): | |
text_buffer = [] |
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 | |
for log in $(/bin/ls -r /var/log/install.log*); do | |
bzgrep 'Writing receipt' $log | awk '{print $1,$2,$3,$10}' | |
done |
OlderNewer