This file contains 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 | |
/** | |
* Gets a field from a resource based on a supplied resource id, meant to be used as an output filter. | |
* | |
* Based on a resource ID a field can be retrieved. This can be standard fields as 'pagetitle' or 'alias', | |
* but a few custom fields are also available; 'siblingNextId', 'childrenFirstId', and 'childrenCount'. | |
* Only resources that are not marked as 'deleted' or 'hidemenu', and that is marked as 'published' are returned. | |
* Examples: | |
* [[*id:toResourceField]] => returns the resource pagetitle | |
* [[*id:toResourceField=`alias`]] => returns the resource alias |
This file contains 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
for(var f=[0,1], i=0; i<20; f[i+2]=f[i++]+f[i]); |
This file contains 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 | |
// Allowing view-source on GET requests using a view-source parameter in the query string | |
if('GET' == $_SERVER['REQUEST_METHOD'] && array_key_exists('view-source', $_GET)) { | |
highlight_file(__FILE__); | |
die(); | |
} | |
// Rest of the code... |
This file contains 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
var id = window.setTimeout(function() {}, 0); | |
while(id--) { | |
window.clearTimeout(id); | |
}; | |
var delay = 1000, // delay in ms | |
correction_24 = 255 / 24, | |
correction_60 = 255 / 60; | |
refreshData = function() { | |
var d = new Date() |
This file contains 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 | |
if(!function_exists('apache_request_headers')) { | |
/// | |
function apache_request_headers() { | |
// Based on: http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers | |
$arrCasedHeaders = array( | |
// HTTP | |
'Dasl' => 'DASL', | |
'Dav' => 'DAV', |
This file contains 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
url = window.location.href.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/); if(url[2] !== undefined) { id = url[2].split(/[^0-9a-z_\-]/i)[0]; el = document.getElementsByTagName('html')[0]; el.style.height = "100%"; el.innerHTML = '<body style="width:100%;height:100%;padding:0;margin:0;"><iframe width="100%" height="100%" src="https://www.youtube.com/embed/' + id + '" frameborder="0" allowfullscreen></iframe></body>'; } else { alert('No video was found'); } |
This file contains 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 type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
This file contains 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
/** | |
* Reference and translate HTTP Status Codes | |
* Modified from: https://github.com/prettymuchbryce/node-http-status/blob/master/index.js | |
* Implemented according to: | |
* - http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml | |
* - https://httpstatuses.com/ | |
* - https://en.wikipedia.org/wiki/List_of_HTTP_status_codes | |
* - http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpStatus.html | |
* | |
* @returns {Object} - HTTP Status Code constants and a method to translate status codes to a description |