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
/* HC-SR04 Sensor | |
https://www.dealextreme.com/p/hc-sr04-ultrasonic-sensor-distance-measuring-module-133696 | |
This sketch reads a HC-SR04 ultrasonic rangefinder and returns the | |
distance to the closest object in range. To do this, it sends a pulse | |
to the sensor to initiate a reading, then listens for a pulse | |
to return. The length of the returning pulse is proportional to | |
the distance of the object from the sensor. | |
The circuit: |
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 | |
$taxonomy = 'category'; | |
// get the term IDs assigned to post. | |
$post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); | |
// separator between links | |
$separator = ', '; | |
if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { |
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 supportsSVG() { | |
return !! document.createElementNS && !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect; | |
} | |
if (!supportsSVG()) { | |
var imgs = document.getElementsByTagName('img'); | |
var dotSVG = /.*\.svg$/; | |
for (var i = 0; i !== imgs.length; ++i) { | |
if(imgs[i].src.match(dotSVG)) { | |
imgs[i].src = imgs[i].src.slice(0, -8) + 'png'; | |
} |
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
// CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie) | |
// Timing functions are the same as demo'ed here: http://jqueryui.com/demos/effect/easing.html | |
// EASE IN | |
$ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530); | |
$ease-in-cubic: cubic-bezier(0.550, 0.055, 0.675, 0.190); | |
$ease-in-quart: cubic-bezier(0.895, 0.030, 0.685, 0.220); | |
$ease-in-quint: cubic-bezier(0.755, 0.050, 0.855, 0.060); | |
$ease-in-sine: cubic-bezier(0.470, 0.000, 0.745, 0.715); | |
$ease-in-expo: cubic-bezier(0.950, 0.050, 0.795, 0.035); |
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
<div id="container"> | |
<div class="sidebar_left "> | |
<a href="#" class="close mobile-only">X</a> | |
<div class="inner-div"> | |
Content Goes Here | |
</div> | |
</div> | |
<div class="sidebar_right mobile-only"> | |
<a href="#" class="close mobile-only">X</a> | |
<div class="inner-div"> |
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
ModPagespeed off |
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
<div class="box"> | |
<div class="header">header</div> | |
<div class="nav">nav</div> | |
<div class="content">content</div> | |
<div class="footer">footer</div> | |
</div> |
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
Select * from wp_posts where post_type = 'attachment'; |
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 $args = array( | |
'post_type' => 'attachment', | |
'numberposts' => 1, | |
'orderby' => 'rand', | |
'post_status' => null, | |
'post_parent' => get_the_ID(), | |
'post_mime_type' => 'image' | |
); | |
$images = get_children( $args ); |
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 type="text/javascript"> | |
function gup( name ) | |
{ | |
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); | |
var regexS = "[\\?&]"+name+"=([^&#]*)"; | |
var regex = new RegExp( regexS ); | |
var results = regex.exec( window.location.href ); | |
if( results == null ) | |
return ""; | |
else |
OlderNewer