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> | |
<head> | |
<title>Event Bubbling</title> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var div1 = document.querySelector("#div1"); | |
var div2 = document.querySelector("#div2"); | |
div1.addEventListener("click", function (event) { |
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 | |
/** | |
* @file | |
* Examples of valid statements for a Drush runtime config (drushrc) file. | |
* | |
* Use this file to cut down on typing out lengthy and repetitive command line | |
* options in the Drush commands you use and to avoid mistakes. | |
* | |
* Rename this file to drushrc.php and optionally copy it to one of the places |
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 ($, tag) { | |
var flickrParams, | |
vimeoParams, | |
apiCalls = []; | |
tag.photosets = null; | |
tag.videos = null; | |
if(opts.flickr && opts.flickr.api_key && opts.flickr.user_id) { |
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('max_execution_time', 0); | |
ini_set('memory_limit', '3096M'); | |
$entities = db_select('drealty_listing','dr') | |
->fields('dr', array('rets_key', 'id')) | |
->execute() | |
->fetchAllKeyed(); | |
foreach($entities as $id => $eid) { | |
$q = db_select('file_managed', 'fm') | |
->condition('filename', $id . '%', 'LIKE') |
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(ng) { | |
ng | |
.module('app', ['ngRoute']) | |
.run($run); | |
// Safely instantiate dataLayer | |
var dataLayer = window.dataLayer = window.dataLayer || []; | |
$run.$inject = ['$rootScope', '$location']; |
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 selectors = { | |
'.sidebar' : -20, | |
'.prop-details': -50, | |
} |
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 my_module_slider_alter($slideshow, $this->id, $this->settings) { | |
$output = picturefill_wp_apply_to_html($slideshow); | |
return $output; | |
} | |
add_filter('metaslider_slideshow_output', 'my_module_slider_alter'); |
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
# update | |
sudo yum -y update | |
# install nginx -- the web server to be used with this installation | |
# for virtual host configuration visit https://gist.github.com/Mulkave/6103129 | |
sudo yum install nginx | |
# install php and mysql | |
sudo yum -y install mysql mysql-server php54 php54-cli php54-gd php54-intl php54-mbstring php54-mcrypt php54-mysql php54-pdo php-pear php54-xml php54-xmlrpc |
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 | |
/* | |
Plugin Name: BT Image Optimization | |
Plugin URI: http://bluetent.com | |
Description: Provides image optimization capabilities as users upload images to the library. | |
Author: ethan@bluetent.com | |
Version: 0.1 | |
Author URI: http://bluetent.com/ | |
Text Domain: bt-image-optimize | |
License: GPLv2 |
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 | |
add_filter( 'preprocess_comment', 'bt_preprocess_comment' ); | |
function bt_preprocess_comment($comment) { | |
// the comment_content column should never by greater than 64kb | |
if ( strlen( $comment['comment_content'] ) > 65534 ) { | |
wp_die('Comment is too long.'); | |
} | |
return $comment; | |
} |