- Event type:
ObjectCreated
- Suffix:
jpg
AWS_KEY
AWS_SECRET
KRAKEN_SECRET
<?php | |
// changes CSS and JavaScript URLs from `css/style.css?ver=1.3.3.7` to `css/style.1.3.3.7.css` | |
if ( ! is_admin() ) { | |
foreach ( array( 'style_loader_src', 'script_loader_src' ) as $filter ) { | |
add_filter( $filter, function( $url ) { | |
// abort if `$url` doesn't start with `WP_CONTENT_URL` |
<?php | |
use Aws\S3\S3Client; | |
use ZipStream\ZipStream; // https://github.com/maennchen/ZipStream-PHP | |
use GuzzleHttp\Client as HttpClient; | |
protected function streamAsZip($files) | |
{ | |
$s3 = S3Client::factory('...'); | |
$zip = new ZipStream("foobar.zip"); |
<?php | |
if ( ! is_admin() ) { | |
add_action( 'parse_query', function( $query ) { | |
if ( $query->is_search ) { | |
unset( $_GET['s'], $_POST['s'], $_REQUEST['s'] ); | |
$query->set( 's', '' ); | |
$query->is_search = false; | |
$query->set_404(); | |
header( $_SERVER[ 'SERVER_PROTOCOL' ] . ' 404 Not Found' ); |
/** | |
* Time-to-live in seconds for cached requests. | |
*/ | |
const cacheTtl = 300; | |
/** | |
* List of request paths to cache. | |
*/ | |
const cachedPaths = [ |
<?php | |
// always paste as plain text | |
foreach ( array( 'tiny_mce_before_init', 'teeny_mce_before_init') as $filter ) { | |
add_filter( $filter, function( $mceInit ) { | |
$mceInit[ 'paste_text_sticky' ] = true; | |
$mceInit[ 'paste_text_sticky_default' ] = true; | |
return $mceInit; | |
}); | |
} |
<?php | |
var_dump('PhpRedis: '. phpversion('redis')); | |
$redis = new RedisCluster( | |
null, | |
[ | |
'tls://127.0.0.1:7001', | |
'tls://127.0.0.1:7002', | |
], |
<script> | |
(function(key) { | |
var script = document.createElement('script'); | |
script.src = 'https://static.leaddyno.com/js'; | |
script.async = true; | |
script.onload = function () { | |
LeadDyno.key = key; | |
LeadDyno.recordVisit(); | |
LeadDyno.autoWatch(); | |
}; |
<?php | |
add_filter( 'get_user_option_admin_color', function( $color_scheme ) { | |
global $_wp_admin_css_colors; | |
if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) { | |
$color_scheme = 'ectoplasm'; | |
} |
<?php | |
namespace App\Providers; | |
use Auth; | |
use App\Support\EloquentUserProvider; | |
class AuthServiceProvider extends ServiceProvider | |
{ | |
public function boot(GateContract $gate) |