Skip to content

Instantly share code, notes, and snippets.

View brianshim's full-sized avatar

Brian Shim brianshim

View GitHub Profile
@marklchaves
marklchaves / disable-popup-maker-if-using-divi-builder.php
Last active January 19, 2023 11:13
Disable Popup Maker if Using Divi Builder
<?php // Ignore this first line when copying to your child theme's functions.php file.
/**
* Disable Popup Maker if Using Divi Builder
*
* Reference https://github.com/stefanoferrario/Extra/blob/e5eb5b20e6165ee989b8538f8eebbcddd24ce4b7/core/functions.php#L353
*/
add_action( 'wp', function() {
if ( ! function_exists( 'et_core_is_fb_enabled' ) ) return;
@gmazzap
gmazzap / www-post-thumb.php
Last active January 28, 2023 03:57
WordPress plugin that allow to use an external image url as featured image.
<?php namespace GM\WWWPostThumbnail;
/**
* Plugin Name: WWW Post Thumbnail
* Description: Allow to use an external image url as featured image.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c
* Author: Giuseppe Mazzapica
* Author URI: https://github.com/Giuseppe-Mazzapica
* License: MIT
* Version: 0.1.0
*
@jeremejazz
jeremejazz / polygonCenter.js
Last active February 22, 2021 21:19
Return Center polygon in google maps v3. This does not apply to some shapes though. I recommend using turf.js instead https://turfjs.org/
function polygonCenter(poly) {
var lowx,
highx,
lowy,
highy,
lats = [],
lngs = [],
vertices = poly.getPath();
for(var i=0; i<vertices.length; i++) {
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/