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 | |
/* =BEGIN: Add Class to first Paragraph in WordPress the_content(); | |
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/ | |
---------------------------------------------------------------------------------------------------- */ | |
function first_paragraph($content){ | |
// Testing to see if the content is a Page or Custom Post Type of school, if so, display the text normally (without the class = intro). | |
if ( is_page() || ('school' == get_post_type() ) ) { | |
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1); | |
} else { | |
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1); |
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 | |
/** | |
* Improves the WordPress caption shortcode with HTML5 figure & figcaption, microdata & wai-aria attributes | |
* | |
* Author: @joostkiens | |
* Licensed under the MIT license | |
* | |
* @param string $val Empty | |
* @param array $attr Shortcode attributes | |
* @param string $content Shortcode content |
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
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" title="main" href="normalize.min.css" type="text/css"> | |
<link rel="stylesheet" title="main" href="main.css" type="text/css"> | |
<link rel="alternate stylesheet" title="red" href="red.css" type="text/css"> | |
<link rel="alternate stylesheet" title="blue" href="blue.css" type="text/css"> |
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 | |
//ini_set('display_errors',1); | |
//error_reporting(E_ALL | E_WARNING); | |
function is_valid_url($url){ | |
$url = filter_var($url, FILTER_SANITIZE_URL); | |
return filter_var($url, FILTER_VALIDATE_URL); | |
} | |
/* RUNTIME */ |
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
# This command will make sure the process persists | |
# even after you log out of a session | |
node server.js >/dev/null 2>&1 & |
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 | |
/** | |
* Return an ID of an attachment by searching the database with the file URL. | |
* | |
* First checks to see if the $url is pointing to a file that exists in | |
* the wp-content directory. If so, then we search the database for a | |
* partial match consisting of the remaining path AFTER the wp-content | |
* directory. Finally, if a match is found the attachment ID will be | |
* returned. | |
* |
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 | |
/** | |
* This file can be used to validate that the WordPress wp_mail() function is working. | |
* To use, change the email address in $to below, save, and upload to your WP root. | |
* Then browse to the file in your browser. | |
* | |
* For full discussion and instructions, see the associated post here: | |
* http://b.utler.co/9L | |
* | |
* Author: Chad Butler |
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 | |
/** | |
* The following example combines Fat-Free Framework | |
* with the PHP Debugger (Toolbar) Tracy. | |
* | |
* @see https://github.com/bcosca/fatfree/issues/999 | |
*/ | |
use Tracy\Debugger; |
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
@mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){ | |
a { | |
color: inherit; | |
text-decoration: none; | |
background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text); | |
background-size: .05em 1px, .05em 1px, 1px 1px; | |
background-repeat: no-repeat, no-repeat, repeat-x; | |
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background; | |
background-position-y: $position,$position, $position; | |
background-position-x: 0%, 100%, 0%; |