Skip to content

Instantly share code, notes, and snippets.

@nciske
nciske / filter-nav-menus.php
Last active July 29, 2022 10:00
Filter nav menus to allow shortcodes in labels and domain agnostic URLs
<?php
// Add a custom menu item with the URL "_SITEURL_/test" and label "[test]" to see it in action
add_filter('wp_nav_menu', 'menu_shortcodes');
function menu_shortcodes( $menu ){
return str_replace('_SITEURL_',preg_replace("~^(?:f|ht)tps?://~i", '', home_url() ), do_shortcode( $menu ) );
}
@spion
spion / food.md
Last active October 13, 2015 20:37
Diet basics

This article contains some basic condensed knowledge about food.

Basic metabolism mechanics

Water

Water - your metabolism needs it. Have a full hand-held bottle nearby at all times. Drink liberally - most estimates of recommended amount fall between 3-5 liters per day (a lot more than what you will usually drink).

Infact, forget all other drinks, especially soft drinks and artificial juices. Most of them are sugary and will become fat minutes after you drink them. Replace them all with water.

@andrijeski
andrijeski / ecchi.sql
Created June 18, 2012 04:19 — forked from georgestephanis/ecchi.sql
sql for ecchi
UPDATE `wp_term_taxonomy`
SET `parent` = '1013'
WHERE `parent` = '0'
AND `taxonomy` = 'category'
AND `term_id` != '1013'
@sente
sente / formatXML.js
Last active April 4, 2024 12:20
javascript to format/pretty-print XML
The MIT License (MIT)
Copyright (c) 2016 Stuart Powers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: