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
<script> | |
!function(e,t,r){function n(){for(;d[0]&&"loaded"==d[0][f];)c=d.shift(),c[o]=!i.parentNode.insertBefore(c,i)}for(var s,a,c,d=[],i=e.scripts[0],o="onreadystatechange",f="readyState";s=r.shift();)a=e.createElement(t),"async"in i?(a.async=!1,e.head.appendChild(a)):i[f]?(d.push(a),a[o]=n):e.write("<"+t+' src="'+s+'" defer></'+t+">"),a.src=s}(document,"script",[ | |
"//code.jquery.com/jquery-latest.js", | |
"js/ui.js" | |
]); | |
</script> |
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
/* | |
From http://responsivenews.co.uk/post/18948466399/cutting-the-mustard : | |
As the application loads we earmark incapable browsers with the above code and exclude the bulk of the Javascript powered UI from them, leaving them with clean, concise, core experience. | |
Here’s the justification for each condition:- | |
document.querySelector - A large part of any JS library is its DOM selector. If the browser has native CSS selecting then it removes the need for a DOM selector. QuerySelector has been available in Firefox since 3.5 at least and has been working in webkit for ages. It also works in IE9. | |
window.localStorage - Although we are not using it yet, we are planning on making considerable use of it. Imagine that if you first came to the mobile site we downloaded all the stories straight away and stored them in localStorage. They’d then be available to use while you are going through an areas of sketchy bandwidth. |
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
# Include a TYPO3 ExtBase plugin via TypoScript using AddThis extension as an example | |
# www.mhm.li | [email protected] | 5/2014 | Free use, no credit required | |
lib.share = USER | |
lib.share { | |
userFunc = tx_extbase_core_bootstrap->run | |
extensionName = Addthis | |
pluginName = Pi1 | |
stdWrap { | |
wrap = <section class="share">|</section> |
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
# Next / previous | |
# Generates links to the previous and next pages in the same level as the current page | |
# Define the terms for "next page" and "previous page" in the TS constants, or amend | |
# the following code to use Locallang files. | |
# 17.12.2013 mhm.li | [email protected] | |
lib.nextprevious = COA | |
lib.nextprevious { | |
wrap = <div class="turn">|</div> |
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
# Unpack files via command line (including via SSH connections) | |
# www.mhm.li | [email protected] | 6/2014 | Free use, no credit required | |
If a file ends in .zip (for example, file.zip), type: | |
unzip file.zip | |
If a file ends in .tar (e.g., file.tar), type: | |
tar -xvf file.tar | |
If a file ends in .gz (for example, file.gz), type: |
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
# Protect folder using htpasswd file | |
# www.mhm.li | [email protected] | 6/2014 | Free use, no credit required | |
AuthName "Private area" | |
AuthType Basic | |
AuthUserFile /path/to/webroot/.htpasswd | |
AuthGroupFile /dev/null | |
require valid-user | |
Order allow,deny | |
Allow from xxx.xxx.xx.xxx |
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
# Create page link according to type of variable | |
# If link variable is an integer, use f:link.page else use f:link.external | |
# TYPO3 Extbase / Fluid | |
# www.mhm.li | [email protected] | 6/2014 | Free use, no credit required | |
<f:if condition="{link}"> | |
<f:if condition="{link -> v:math.round()} > 0"> | |
<f:then> | |
<f:link.page pageUid="{link}">Link text</f:link.page> | |
</f:then> |
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
# CSS file versioning using htaccess file (Apache config) | |
# Link to the file style.123456.css and the server will deliver style.css | |
# Change the number and the web browser will see it as a different file | |
# and force it to be loaded afresh | |
# permanenttourist.ch | [email protected] | 6/2014 | Free use, no credit required | |
# Warning: use only numeric sequences for the version reference! | |
# Warning: if a file with the actual name really exists, it will be served! | |
RewriteCond %{REQUEST_FILENAME} !-s |
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
# The following code creates a link with a translated link text | |
# linking automatically to the translated version of the page $pageID | |
# Tech: WordPress / WPML / PHP | |
# External ref. http://wpml.org/documentation/support/creating-multilingual-wordpress-themes/hard-coded-theme-links/ | |
<?php echo( icl_link_to_element($pageID, 'page', __('Link text','myTheme' ), '','',false,true)); ?> |