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 (s) { | |
"use strict"; | |
var e, | |
p; | |
// Load CSS | |
e = document.createElement("link"); | |
p = document.getElementsByTagName("head")[0]; | |
e.rel = "stylesheet"; | |
e.href = s; | |
e.media = "only x"; |
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 | |
/** | |
* Instructions: | |
* | |
* 1. Put this into the document root of your Kirby site | |
* 2. Make sure to setup the base url for your site correctly | |
* 3. Run this script with `php statify.php` or open it in your browser | |
* 4. Upload all files and folders from static to your server | |
* 5. Test your site |
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 | |
$results = array(); | |
array_walk($array, function ($value, $key, $field) use(&$results) { | |
$results[$value[$field]] = $value; | |
}, $field); |
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
// Returns False if no number given, number before decimal is | |
// missing and when the decimal shorter than two digits | |
function price_to_float($string) | |
{ | |
// Remove leading and trailing whitespace | |
$string = trim($string); | |
// Check for decimal with comma first | |
if ( (bool) preg_match('/[+-]?[0-9]\,[0-9]{2}(\w|\b)/D', $string)) | |
{ |
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
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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
document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.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
// using a for loop on an object | |
for (key in object) { | |
if (object.hasOwnProperty(key)) { | |
object[key]; | |
} | |
} |
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 | |
/** | |
* Simple PHP if statement to execute recurring tasks | |
* by executing those when visited by a bot | |
*/ | |
if (preg_match('/slurp|googlebot/i', $_SERVER['HTTP_USER_AGENT'])) { | |
// tasks to execute | |
} |
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
/** | |
* Uses Alan Moore's regexp: | |
* http://stackoverflow.com/questions/5312349/minifying-final-html-output-using-regular-expressions-with-codeigniter | |
* | |
* Replace `echo $kirby->launch();` in Kirby’s index.php by | |
* the following code to minify the HTML output | |
* (it leaves whitespace within `<pre>` and `<textarea>` tags untouched) | |
*/ | |
echo preg_replace( | |
'/(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!\/?(?:textarea|pre)\b))*+) |
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
<style> | |
rect, line { shape-rendering: crispEdges; } | |
</style> |
OlderNewer