Skip to content

Instantly share code, notes, and snippets.

window['moment-range'].extendMoment(moment);
const storage = [
["2017-11", 0],
["2018-3", 1964105]
]
const storageGaps = function() {
let gaps = []
storage.map((current, index) => {
@cameronbaney
cameronbaney / markup.html
Created February 16, 2015 15:47
Temple Animated Graphic
<div id="container">
<div id="output">
</div>
</div>
@cameronbaney
cameronbaney / social-links.html
Created October 15, 2014 14:18
Custom social share
@cameronbaney
cameronbaney / Custom WP_Query
Last active August 29, 2015 14:07
WordPress Pagination
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query = new WP_Query(array('post_type'=>$type,'posts_per_page'=>'5','orderby'=>'date','order'=>'DESC','paged'=>$paged));
?>
<div class="pagination">
<?php
$big = 999999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
@cameronbaney
cameronbaney / gist:dc367971794dfcd9da54
Last active August 29, 2015 14:05
Transition and Animation end with Modernizr
// Required Modernizr.prefixed()
// Animation callback
var animEndEventNames = {
'WebkitAnimation' : 'webkitAnimationEnd',// Saf 6, Android Browser
'MozTAnimation' : 'animationend', // only for FF < 15
'animation' : 'animationend' // IE10, Opera, Chrome, FF 15+, Saf 7+
},
animEndEventName = animEndEventNames[ Modernizr.prefixed('animation') ];
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
@cameronbaney
cameronbaney / css3-modal-ajax.js
Last active August 29, 2015 14:00
External page content into CSS3 Modal
$('.btn.go').on('click',function(){
// Set the modal's content as a variable for achcing
$modalContent = $('.modal-content');
// Add a loading signifier
$modalContent.html('Loading...');
// Get the external URL
$.ajax({
url: $(this).attr('href'),
@cameronbaney
cameronbaney / gist:10541834
Created April 12, 2014 15:37
Social sharing on Youtube
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
****INSTRUCTIONS****
To use this, link to this file in your annotations with ?v={videoID}
For Example: http://MyWebSite.tld/facebookshare.html?v=GWRnHGjLDpk
If you have any questions or suggestions, please PM my Youtube account: http://www.youtube.com/user/ThreeDigitIQ
@cameronbaney
cameronbaney / fetch-vid.js
Created February 27, 2014 20:33
How to prefetch video/audio files for uninterrupted playback in HTML5 video/audio
function prefetch_file(url,
fetched_callback,
progress_callback,
error_callback) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "blob";
xhr.addEventListener("load", function () {
if (xhr.status === 200) {