Skip to content

Instantly share code, notes, and snippets.

View dannomatic's full-sized avatar
🏠
Working from home

Dan Nedelko dannomatic

🏠
Working from home
View GitHub Profile
//redirect non logged in users to homepage
function bp_guest_redirect() {
global $bp;
if(!is_user_logged_in()&&!(bp_is_page(BP_REGISTER_SLUG)||bp_is_page(BP_ACTIVATION_SLUG)||is_front_page())) { // not logged in user
wp_safe_redirect( bp_get_root_domain());//make sure page exists exist slug welcome
exit(0);//no further execution
}
}
@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/
@thomasrstegelmann
thomasrstegelmann / targeted-auto-follow.js
Last active November 1, 2024 20:25
I modified Karan's script to follow only profiles that match a certain keywords to follow only relevant accounts. Please see https://medium.com/marketing-102/how-i-grew-from-300-to-5k-followers-in-just-3-weeks-2436528da845#.75mau0pj9 for details
a = setInterval(function () {
window.scrollTo(0,document.body.scrollHeight);
$(".ProfileCard-userFields").each( function() {
if($(this).find('.ProfileCard-bio').text().match(new RegExp("google|twitter|airbnb|entrepreneur|founder|tech|growthhacking|hacking|official|consultant|analytics|ecom|startup|ceo|ux|seo|ecommerce|growth"), "g") !== null )
{
$(this).parent().find('.not-following .user-actions-follow-button.js-follow-btn').click();
}
@RichardNesbitt
RichardNesbitt / functions.php
Last active April 23, 2024 09:06
WP Bakery Page Builder - Add URL option to make entire column clickable - Updated 22 June 2023
<?php
/* add this to your theme's functions.php file */
/* Add option for URL to column settings */
vc_add_param("vc_column", array(
"type" => "vc_link",
"class" => "",
"heading" => "Column Link",