This file contains hidden or 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 | |
// Default options values | |
$html5press_options = array( | |
'back_to_top' => true, | |
'featured_image_size' => 'large', | |
'featured_cat' => '', | |
'num_featured' => '5' | |
); |
This file contains hidden or 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
// Register all the javascript and css we need to accompany those scripts | |
add_action( 'init', 'html5press_register_scripts' ); | |
function html5press_register_scripts() { | |
if ( !is_admin() ) { | |
/** | |
* Modernizr enables HTML5 elements & feature detects | |
* For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ | |
*/ | |
wp_enqueue_script( 'modernizr', get_stylesheet_directory_uri() . '/js/modernizr-2.0.min.js', '', '2.0' ); |
This file contains hidden or 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
// Enable maintenance mode | |
add_action('get_header', 'html5press_maintenance_mode'); | |
function html5press_maintenance_mode() { | |
wp_die('Maintenance, please come back soon.'); | |
} |
This file contains hidden or 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('pre_get_posts', 'optimized_get_posts', 100); | |
function optimized_get_posts() { | |
global $wp_query, $wpdb; | |
$wp_query->query_vars['no_found_rows'] = 1; | |
$wp_query->found_posts = $wpdb->get_var( "SELECT COUNT(*) FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')" ); | |
$wp_query->found_posts = apply_filters_ref_array( 'found_posts', array( $wp_query->found_posts, &$wp_query ) ); | |
$wp_query->max_num_pages = ceil($wp_query->found_posts / $wp_query->query_vars['posts_per_page']); | |
return $wp_query; |
This file contains hidden or 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
~$ ssh [email protected] -L 3306:127.0.0.1:3306 -N | |
~$ ctrl-z | |
~$ bg <---background the tunnel | |
~$ mysql-query-browser | |
Connect to 127.0.0.1 with credentials from /root/.my.cnf | |
~$ fg <---bring tunnel to foreground | |
~$ ctrl-c <---end tunnel |
This file contains hidden or 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
input.button, a.button, span.button { | |
color: #6e6e6e; | |
text-decoration: none; | |
padding: 2px 12px; | |
position: relative; | |
display: inline-block; | |
text-shadow: 0 1px 0 #fff; | |
-webkit-transition: border-color .218s; | |
-moz-transition: border .218s; | |
-o-transition: border-color .218s; |
This file contains hidden or 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/perl | |
########################################################################### | |
# This parses apache access log files for nimda or code red attempts. # | |
# It will return the number of attempts and will show the last one and # | |
# who it came from.. # | |
########################################################################### | |
# Author: Tyler L. Longren | |
# E-mail: [email protected] | |
# URL: http://longren.org | |
# |
This file contains hidden or 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
[FineUploader] Processing 1 files or inputs... /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:10 | |
[FineUploader] Sending upload request for 0 /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:10 | |
[FineUploader] xhr - server response received for 0 /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:10 | |
[FineUploader] responseText = /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:10 | |
[FineUploader] Error when attempting to parse xhr response text (SyntaxError: Unexpected end of input) /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:12 | |
qq.log /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:12 | |
qq.FineUploaderBasic.log /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:37 | |
qq.UploadHandler.log /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:48 | |
parseResponse /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:215 | |
onComplete /http://www.longren.org/nexus4/jquery.fineuploader-3.3.1.js:223 |
This file contains hidden or 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 createUploader() { | |
var uploader = new qq.FineUploader({ | |
element: document.getElementById('bootstrapped-fine-uploader'), | |
debug: false, | |
request: { | |
endpoint: 'http://sub.domain.com/upload.php', | |
paramsInBody: false, | |
params: { | |
folder: '<?=$folder?>', | |
mirror: "<?=$_SESSION['u_name']?>" |
This file contains hidden or 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 | |
$slug = slugit("thank you for visiting"); | |
echo $slug; | |
// returns: thank-you-for-visiting | |
?> |
OlderNewer