Skip to content

Instantly share code, notes, and snippets.

@sdiama
sdiama / webview.js
Created May 29, 2019 17:47
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@dejanmarkovic
dejanmarkovic / NOBLOGREDIRECT explained and fix
Created January 8, 2014 20:15
NOBLOGREDIRECT explained and fix
A little explanation for those who have no idea what NOBLOGREDIRECT is.
The define(‘NOBLOGREDIRECT’, ‘%siteurl%’); inside of the wp-config.php makes it so that when someone enters a subdomain that does not exist on your site to redirect to whatever url you wish it to. You can use this to have it either go to a specific FAQ page or directly back to the main root installation, anywhere you want to direct it. the %siteurl% can be replaced for example define(‘NOBLOGREDIRECT’, ‘http://frumph.net/FAQ/site-create’);
When someone in their browser tries to go to (for example) http://badsubdomain.frumph.net/ a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT.
Without using NOBLOGREDIRECT the (for example) http://badsubdomain.frumph.net/ – which is a subdomain that doesn’t exist would direct to the signup page asking which reports whether or not the user can create the bad subdomain in question. This is fine, there’s nothing wrong with it redirecting to the signup page if someone put
@jtcote
jtcote / gumwp_media_lib_show_author_uploads_only.php
Last active December 22, 2015 22:59
WP media library filter to display only logged in users uploaded files
<?php
/**
* Media Library - View logged in author uploads only
*
* @package GUM WP Child Theme Functions
* @author Jayson T. Cote <askjayson@gmail.com>
* @copyright Copyright (c) 2013, Jayson T. Cote
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*
*/