Skip to content

Instantly share code, notes, and snippets.

@facelordgists
facelordgists / Email-Qmail-Spam-cleanup-and-prevention.md
Last active May 21, 2019 08:48
TERMINAL: Email / Qmail Spam cleanup and prevention

#Qmail spam prevention:

Start Qmail

/etc/init.d/qmail start
/etc/init.d/xinetd start

Stop Qmail

/etc/init.d/qmail stop

@facelordgists
facelordgists / wp-excerpt-outside-loop.php
Created May 2, 2013 22:41
WORDPRESS: get excerpt outside loop
<?
/* works pretty well */
function the_excerpt_max_charlength($id=false, $charlength=55) {
global $post;
$old_post = $post;
if ($id != $post->ID) {
$post = get_page($id);
}
@facelordgists
facelordgists / install-sass.md
Last active November 13, 2019 22:47
How to install SASS and Ruby

Easy Mac Install for Sass and Compass

gem update --system
gem update *
gem install sass
gem install compass

Update to Install Ruby 2.0 w/ readline support for Guard:liveReload

@facelordgists
facelordgists / nginxDomainVirtualHost.php
Created May 11, 2013 04:00
SERVER: Plesk nginx expires headers config
<?php
/**
* @var Template_VariableAccessor $VAR
* @var array $OPT
* Stored in /usr/local/psa/admin/conf/templates/custom/domain/
*/
?>
server {
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['defaultIp'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') ?>;
@facelordgists
facelordgists / Optimize-nginx.md
Last active November 21, 2016 12:01
SERVER: nginx & apache - Enable Gzip & future headers + disable etags
@facelordgists
facelordgists / filter-hybrid-entry-titles.php
Created June 12, 2013 21:21
WORDPRESS: Filter Hybrid Entry Titles
<?
// Filter Hybrid Entry Titles
add_filter( 'hybrid_entry_title', 'remove_links_from_headings' );
function remove_links_from_headings($title){
if ( is_single()) {
// display H1 tag on single blog posts using the following markup
return '<h1 class="page-title entry-title">' . get_the_title() . '</h1>';
} elseif( is_front_page() || is_page() ){
// destroy H1 tag on static home page and all single pages
return '';
#!/bin/bash
##############################
# DEFAULT WORDPRESS AND PLUGIN INSTALL SCRIPT
#
# 2012-04-03
# 1.0
# TODO: PUT A YES/NO PROMPT BEFORE RUNNING SCRIPT
#!!!!! EXITS UNLESS YOU MANUALLY COMMENT OUT THE LINE BELOW
exit
@facelordgists
facelordgists / royal-slider-custom-variable-array.php
Created June 23, 2013 08:02
Royal Slider Custom Variable Array.php
<?
class MyRoyalSliderRendererHelper {
private $post;
private $options;
function __construct( $data, $options ) {
$this->post = $data;
$this->options = $options;
}
function array_test() {
$var = array(
@facelordgists
facelordgists / git auto deploy.md
Created June 26, 2013 09:31
TERMINAL: Git Autodeploy instructions