Skip to content

Instantly share code, notes, and snippets.

@dale3h
dale3h / jail.local
Created June 29, 2018 15:47
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@jchristopher
jchristopher / gist:9d1d2df6d92d084884ee
Last active January 28, 2019 13:32
Customize the parent element for SearchWP Live Ajax Search results
<?php
function my_searchwp_live_search_configs( $configs ) {
// override some defaults
$configs['default'] = array(
'engine' => 'default', // search engine to use (if SearchWP is available)
'parent_el' => '#results-loop', // have the results show up in a custom element
'input' => array(
'delay' => 500, // wait 500ms before triggering a search
'min_chars' => 3, // wait for at least 3 characters before triggering a search
@Meroje
Meroje / comment.php
Created December 4, 2013 07:43
TimeDiff For Humans
<?php
use Carbon\Carbon;
class Comment extends Eloquent {
protected $guarded = array();
protected $softDelete = true;
public static $rules = array();