This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Close out any open tags | |
* via: http://milianw.de/code-snippets/close-html-tags | |
*/ | |
function closetags( $html ) { | |
#put all opened tags into an array | |
preg_match_all('#<([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result); | |
$openedtags = $result[1]; | |
#put all closed tags into an array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Full navigation | |
============================================= --> | |
<nav class="full {{ settings.mobile-navigation-colour-scheme }}"> | |
<!-- Main nav | |
++++++++++++++++++++++++++++ --> | |
<ul> | |
{% for link in linklists.main-menu.links %}<li class="nav-item {% include 'for-looper' %} {% if link.title == settings.catalog-label-override and settings.enable-mega-nav %}has-mega-nav{% endif %} {% capture link_handle %}{{ link.title | handle }}{% endcapture %} {% if linklists[link_handle] and linklists[link_handle].links.size > 0 %}dropdown{% endif %}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Speedy cache | |
* | |
*/ | |
$url = "http://thisis.la"; | |
$file_path = getcwd() . '/cache'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.replaceAllButLast = function( search, replace ) { | |
var tmp = this.slice(0, this.lastIndexOf(search)), | |
end = this.slice(this.lastIndexOf(search)), | |
regex = new RegExp(search.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), 'g'); // Escaping chars | |
return tmp.replace(regex,replace) + end; | |
} | |
String.prototype.replaceAllButFirst = function( search, replace ) { | |
var tmp = this.slice( this.indexOf(search)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#authors li').each(function() { | |
var $self = jQuery(this); | |
var $strong = $self.find('strong'); | |
var $select = $self.find('select'); | |
var username = $strong.text().match(/\(([\w]*)\)/); | |
var matched = false; | |
console.log(username[1]) | |
if (username) { | |
$select.find('option').each(function() { | |
if (jQuery(this).text() === username[1]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Vine - Lazy Load Wrapper | |
* | |
* | |
* @requires jQuery | |
*/ | |
jQuery(document).ready(function($) { | |
var $vine = [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /** | |
* | |
* Adds a Column to WordPress pages admin so you can easily see | |
* which pages are using which page template. | |
* | |
* @since 1.0 | |
*/ | |
function la_modify_page_table ( $columns ) { | |
/* Add a Page Template Column */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Fabric Shipping Costs */ | |
// Wallpaper - Shipping Defaults | |
var arr = [{ | |
"country" : "Guernsey", | |
"shipping_alone": 0, | |
"with_others" : 0 | |
}, | |
{ | |
"country" : "Isle of Man", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculate_base_em() { | |
var d = document.createElement('div'); | |
var base_height; | |
d.style.opacity = 0; | |
d.innerHTML = 'E'; | |
document.body.appendChild(d); | |
base_height = d.offsetHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* WordPress Content Generation | |
* | |
*/ | |
/** | |
* Loads the WordPress Environment and Template | |
*/ |