Cross-browser function to trigger DOM events.
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
/* | |
* insertAdjacentHTML.js | |
* Cross-browser full HTMLElement.insertAdjacentHTML implementation. | |
* | |
* 2011-10-10 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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 | |
/** | |
* Compare two arrays and return a list of items only in array1 (deletions) and only in array2 (insertions) | |
* | |
* @param array $array1 The 'original' array, for comparison. Items that exist here only are considered to be deleted (deletions). | |
* @param array $array2 The 'new' array. Items that exist here only are considered to be new items (insertions). | |
* @param array $keysToCompare A list of array key names that should be used for comparison of arrays (ignore all other keys) | |
* @return array[] array with keys 'insertions' and 'deletions' | |
*/ | |
public static function arrayDifference(array $array1, array $array2, array $keysToCompare = null) { |
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 | |
$slug = slugit("thank you for visiting"); | |
echo $slug; | |
// returns: thank-you-for-visiting | |
?> |
- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
Press minus + shift + s
and return
to chop/fold long lines!
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
Source moved to: https://github.com/Robyer/nette-live-form-validation |
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 | |
// Based on <https://github.com/mecha-cms/x.minify> | |
namespace x\minify\_ { // start namespace | |
$n = __NAMESPACE__; | |
\define($n . "\\token_boolean", '\b(?:true|false)\b'); | |
\define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+'); |
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
/*! | |
* polyfill.insertAdjacentHTML.js | |
* Author: Jared Abbott | |
* Description: A Cross-browser implementation of HTMLElement.insertAdjacentHTML | |
* Copyright 2015 Jared Abbott | |
* Distributed under the MIT license | |
*/ | |
if (!("insertAdjacentHTML" in document.createElementNS("http://www.w3.org/1999/xhtml", "_"))) { | |
HTMLElement.prototype.insertAdjacentHTML = function(position, html) { |
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
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Reis", | |
"url": "http://adam.reis.nz" | |
}, | |
"license": "UNLICENSED", |
OlderNewer