Skip to content

Instantly share code, notes, and snippets.

@ptudor
ptudor / 10-mod_deflate_proxy.conf
Last active December 5, 2022 16:24
two ways to use brotli compression in Apache
# Quick hints for using brotli compression in Apache, available since 2.4.26
#
# method one is for inline proxies with AddOutputFilterByType.
# method two is for static local files with FilesMatch/SetOutputFilter
#
# ptudor 2019
#############################
# /etc/httpd/conf.d/10-mod_deflate_proxy.conf
<If "%{HTTP:Accept-Encoding} =~ /br/">
@alpha1
alpha1 / imports.sql
Last active January 16, 2018 01:25
CE This Week Migration
#prior to running these, grab all held emails from delivra and import as suppressions to phplist.
#Server 2 - All active subscribers from MYB
SELECT
phplist_user_user.id,
TRIM(LOWER(phplist_user_user.email)) as 'email',
'1' as 'Business'
FROM phplist_listuser
LEFT JOIN phplist_user_user ON phplist_listuser.userid = phplist_user_user.id
where `listid` = 3
@phlbnks
phlbnks / gform_clamav.php
Created August 8, 2016 17:21
Scan Gravity Forms uploads with ClamAV - WordPress
/**
* Scan Gravity Forms uploads with ClamAV
* Based on 'Custom Scan AV function by Kris Chase'
* https://krischase.com/detect-and-prevent-malware-in-gravity-forms-file-upload-with-php-clamav/
* Requires clamav and php-clamav installed and enabled
*/
function myfunc_uploads_clamav( $validation_result ) {
if ( $_FILES ) {
$form = $validation_result['form'];
@cgsmith
cgsmith / sparkposthook.php
Created May 25, 2016 13:47
SparkPost Hook for PHPList
<?php
error_reporting(0); // do not log errors to... anywhere :)
$databaseHost = 'localhost';
$databaseName = '';
$databaseUser = '';
$databasePassword = '';
$databaseTable = '';
$phpAuthUser = '';
$phpAuthPass = '';
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@codearachnid
codearachnid / filter_gf_select_optgroup.php
Last active July 16, 2024 15:51
Add the optgroup ability to Gravity Forms default select field.
/**
* Filter Gravity Forms select field display to wrap optgroups where defined
* USE:
* set the value of the select option to `optgroup` within the form editor. The
* filter will then automagically wrap the options following until the start of
* the next option group
*/
add_filter( 'gform_field_content', 'filter_gf_select_optgroup', 10, 2 );
function filter_gf_select_optgroup( $input, $field ) {
@adamloving
adamloving / temporary-email-address-domains
Last active July 24, 2024 20:49
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/