Skip to content

Instantly share code, notes, and snippets.

View herbie4's full-sized avatar
🏠
Working from office

herbert herbie4

🏠
Working from office
View GitHub Profile
@blueprintmrk
blueprintmrk / browser-redirect.js
Created October 19, 2015 23:24 — forked from sickOscar/browser-redirect.js
WPML - browser-redirect.js - Fix
/*globals wpml_browser_redirect_params */
jQuery(document).ready(function () {
if (jQuery.cookie !== undefined) {
// Check if cookie are enabled
jQuery.cookie('wpml_browser_redirect_test', '1');
var cookie_enabled = jQuery.cookie('wpml_browser_redirect_test') === '1';
jQuery.removeCookie('wpml_browser_redirect_test');
if (cookie_enabled) {
@petskratt
petskratt / .htaccess
Last active May 22, 2019 07:10
Perishable Press 6G firewall with slight modifications (archive.org bot enabled, no IP blocking part)
# 6G FIREWALL/BLACKLIST
# @ https://perishablepress.com/6g/
# 6G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} (eval\() [NC,OR]
RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} ([a-z0-9]{2000}) [NC,OR]
RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR]
@annalinneajohansson
annalinneajohansson / .htaccess
Last active November 18, 2019 09:55
# Attempt to load files from production if they're not in our local version. Adapted from: http://stevegrunwell.com/blog/keeping-wordpress-under-version-control-with-git
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^local.site\.com$
RewriteRule ^wp-content/uploads/(.*)$ https://production.site.com/wp-content/uploads/$1 [NC,L]
@greenbicycle
greenbicycle / gist:abceafbec3be09969ad5
Last active April 9, 2020 14:47
Quick script to scan multiple domains with wpscan
#!/bin/bash
#
# Use WPScan to scan sites running Wordpress
# and Store the output somewhere
#
domains='domain1.com example2.com example.com'
# Where do you want output to go? Better without trailing slash
@jrobinsonc
jrobinsonc / wpml.md
Last active May 20, 2020 19:21
WPML WordPress plugin

Setup

To work on this project locally, you'll need to do the following:

  • Make sure you have a couple prereqs installed on your computer
  • Install Virtualbox, Vagrant, VVV and VV
  • Create a new WP site using VV
  • Download a copy of the live site's db and add it to our local site.
  • Install a couple VIP specific things
  • Start working on the site
@Dan0sz
Dan0sz / host-anything-locally.php
Last active April 7, 2021 15:06
Script to host any javascript file locally, which can be scheduled using Crontab
<?php
// Script to update any js-file
// Credits go to: Matthew Horne
// Remote file to download
$remoteFile = 'https://www.google-analytics.com/analytics.js';
$localFile = '/path/to/your/webroot/analytics.js';
// Check if directory exists, otherwise create it.
$uploadDir = '/path/to/your/webroot/';
@spivurno
spivurno / gw-gravity-forms-all-fields-template.php
Last active June 8, 2021 19:10
Gravity Wiz // Gravity Forms // All Fields Template
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-all-fields-template.php
*/
/**
* Gravity Wiz // Gravity Forms // All Fields Template
*
* Modify the {all_fields} merge tag output via a template file.
@gbertb
gbertb / font-awesome.js
Created March 12, 2014 06:40
How to load Font Awesome asynchronously
<!--
How to load Font Awesome asynchronously
Use: Just put this script on the bottom/footer of your web
-->
<script type="text/javascript">
(function() {
var css = document.createElement('link');
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css';
@lukecav
lukecav / functions.php
Last active November 29, 2021 14:16
Disable background image regeneration in WooCommerce 3.3
add_filter( 'woocommerce_background_image_regeneration', '__return_false' );