Skip to content

Instantly share code, notes, and snippets.

View remcotolsma's full-sized avatar
🏢
Working @pronamic

Remco Tolsma remcotolsma

🏢
Working @pronamic
View GitHub Profile
@Biont
Biont / mlp-autosync-terms.php
Last active October 3, 2017 09:34
MLP Autosync Terms
<?php
/**
* Plugin Name: MLP Autosync Terms
* Description: Automatically sync all linked terms when a post is saved
* Author: Biont
* Author URI: https://github.com/Biont
* License: GPLv3
*/
/**
@remcotolsma
remcotolsma / functions.php
Created May 29, 2015 19:19
WordPress filter to display only root categories and sub categories.
<?php
function prefix_get_the_terms( $terms, $post_id, $taxonomy ) {
if ( 'category' == $taxonomy ) {
if ( is_category() ) {
$current = get_queried_object();
$sub_terms = get_terms( $taxonomy, array(
'child_of' => $current->term_id,
'fields' => 'ids',
@remcotolsma
remcotolsma / infinitewp.sql
Last active June 1, 2016 17:27
Queries to delete InfiniteWP site history and stats of deleted sites.
DELETE FROM iwp_history WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
DELETE FROM iwp_history_additional_data WHERE historyID NOT IN ( SELECT historyID FROM iwp_history );
DELETE FROM iwp_history_raw_details WHERE historyID NOT IN ( SELECT historyID FROM iwp_history );
DELETE FROM iwp_site_stats WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
DELETE FROM iwp_user_access WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites );
@davatron5000
davatron5000 / gist:2254924
Created March 30, 2012 20:57
Static Site Generators

Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.

Ruby

@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/