Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Contact Form 7 Conditional Enqueues WordPress Plugin.
*
* @package CF7_Conditional_Enqueues
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2023 Google Inc.
*
* @wordpress-plugin
@WISHPRO
WISHPRO / defer_all_scripts.php
Created November 22, 2023 22:04 — forked from adamsilverstein/defer_all_scripts.php
Hook into `wp_enqueue_script` and defer all scripts using defer strategy from WordPress 6.3.
<?php
/**
* Recursively add the defer strategy to a script and all its dependencies.
*
* @param string $handle The script handle.
* @return void
*/
function recursively_add_defer_strategy( $handle ) {
wp_script_add_data( $handle, 'strategy', 'defer' );
@WISHPRO
WISHPRO / terminal
Created August 30, 2016 14:53
Recursively convert Windows CR+LF to Unix LF in bash Raw
find . -name *.svg -exec perl -pi -e 's/\r\n/\n/g' {} \;
@WISHPRO
WISHPRO / gist
Created August 30, 2016 10:34
CHMOD all files to 644 and directories to 755
find * -type d -print0 | xargs -0 chmod 0755 # for directories
find . -type f -print0 | xargs -0 chmod 0644 # for files

Check Apache Httpd MPM Config Limits

The check_httpd_limits.pl script compares the size of running Apache httpd processes, the configured prefork/worker MPM limits, and the server's available memory. The script exits with a warning or error message if the configured limits exceed the server's available memory.

check_httpd_limits.pl does not use any 3rd-party perl modules, unless the --save/days/maxavg command-line options are used, in which case you will need to have the DBD::SQLite module installed. It should work on any UNIX server that provides /proc/meminfo, /proc/*/exe, /proc/*/stat, and /proc/*/statm files. You will probably have to run the script as root for it to read the /proc/*/exe symbolic links.

Process Description

When executed, the script will follow this general process.

#!/bin/sh
# Author: Vitaliy Ectb
bundle exec rake time:zones:all RAILS_ENV=production
"C:\Program Files\Java\jdk1.7.0_79\bin\keytool.exe" -list -v -keystore %HOMEDRIVE%\%HOMEPATH%\.android\myreleasekey.keystore -alias "alias alias" -storepass "storepass" -keypass "keypass"
set OPENSSL_CONF=C:\Program Files (x86)\GnuWin32\share\openssl.cnf
"C:\Program Files\Java\jdk1.7.0_79\bin\keytool.exe" -exportcert -alias "alias alias" -keystore %HOMEDRIVE%\%HOMEPATH%\.android\myreleasekey.keystore -storepass "storepass" -keypass "keypass" | C:\OpenSSL-Win32\bin\openssl.exe sha1 -binary | C:\OpenSSL-Win32\bin\openssl.exe base64
@WISHPRO
WISHPRO / web.config
Created November 8, 2015 20:54 — forked from allebb/web.config
Laravel 5.x web.config file for Windows Azure hosting
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 GMT" cacheControlMode="UseExpires" />
</staticContent>
#!/bin/sh
#
# Copyright (c) 2015 Fabian Raetz <fabian.raetz@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF