[abc] A single character: a, b or c
[^abc] Any single character but a, b, or c
[a-z] Any single character in the range a-z
[a-zA-Z] Any single character in the range a-z or A-Z
^ Start of line
$ End of line
\A Start of string
\z End of string
. Any single character
\s Any whitespace character
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
/** | |
* Get siblings of an element | |
* @param {Element} elem | |
* @return {Object} | |
*/ | |
var getSiblings = function (elem) { | |
var siblings = []; | |
var sibling = elem.parentNode.firstChild; | |
var skipMe = elem; | |
for ( ; sibling; sibling = sibling.nextSibling ) |
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
/** | |
* Test for @font-face support | |
* @author Filament Group | |
* @link https://github.com/filamentgroup/face-off | |
* @param {Element} win | |
* @param {Null} undefined | |
* @return {Boolean} | |
*/ | |
var isFontFaceSupported = (function( win, undefined ) { |
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
/** | |
* Test for pseudo-selector support | |
* @author Paul Irish | |
* @link https://gist.github.com/paulirish/441842 | |
* @param {String} selector Pseudo-selector to test | |
* @return {Boolean} | |
*/ | |
function selectorSupported(selector){ | |
var support, link, sheet, doc = document, |
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
;(function (window, document, undefined) { | |
'use strict'; | |
// Code goes here... | |
})(window, document); |
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>document.write('<script src="http://' + (location.host || 'localhost') | |
.split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script> |
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 | |
// Get and sanitize the current URL | |
function _s_get_url() { | |
// Get URL | |
$url = @( $_SERVER['HTTPS'] != 'on' ) ? 'http://' . $_SERVER['SERVER_NAME'] : 'https://' . $_SERVER['SERVER_NAME']; | |
// $url .= ( $_SERVER['SERVER_PORT'] !== 80 ) ? ":" . $_SERVER['SERVER_PORT'] : ''; // Uncomment to add port number | |
$url .= $_SERVER['REQUEST_URI']; |
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 | |
// Start browser session (to store alert messages) | |
function _s_start_browser_session() { | |
if(!isset($_SESSION)) { | |
session_start(); | |
} | |
} | |
add_action('init', '_s_start_browser_session'); |
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 | |
// Does string contain letters? | |
function _s_has_letters( $string ) { | |
return preg_match( '/[a-zA-Z]/', $string ); | |
} | |
// Does string contain numbers? | |
function _s_has_numbers( $string ) { | |
return preg_match( '/\d/', $string ); |
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
<!-- Translate --> | |
<?php __( '', 'kraken' ) ?> | |
<!-- Translate and echo --> | |
<?php _e( '', 'kraken' ) ?> | |
<!-- Translate with a variable --> | |
<?php printf( __( 'Thing one %s', 'kraken' ), $thing1 ); ?> | |
<!-- Translate with multiple variables --> |
OlderNewer