Skip to content

Instantly share code, notes, and snippets.

View ryarwood's full-sized avatar

Russell Yarwood ryarwood

View GitHub Profile
@ryarwood
ryarwood / simple-nav.html
Last active June 9, 2016 03:17
A simple stupid nav.
<nav class="global">
<ul>
<li><a href="/foobar/">Foobar</a></li>
<li><a href="/foobar/">Foobar</a></li>
<li><a href="/foobar/">Foobar</a></li>
<li><a href="/foobar/">Foobar</a>
<ul>
<li><a href="/foobar/">Foobar</a></li>
<li><a href="/foobar/">Foobar</a></li>
<li><a href="/foobar/">Foobar</a></li>
@ryarwood
ryarwood / scoll-reveal-example.js
Last active April 28, 2016 23:49
Scroll reveal example. For more information visit: https://github.com/jlmakes/scrollreveal.js
var fooReveal = {
origin : 'bottom',
distance : '20px',
duration : 500,
delay : 0,
rotate : { x : 0, y : 0, z : 0 },
opacity : 0,
scale : 0.9,
easing : 'cubic-bezier( 0.6, 0.2, 0.1, 1 )',
container : null,
@ryarwood
ryarwood / timeline.html
Created February 4, 2016 22:35
Simple Timeline Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenLite.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TimelineLite.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/plugins/CSSPlugin.min.js'></script>
@ryarwood
ryarwood / videoswap-titles.js
Last active February 10, 2016 17:06
Video Swap Javascript
$(document).ready(function(){
$(".top10_video").fitVids();
$(".top10_videolist .active").click(function(event){
event.preventDefault();
});
});
currentFeature = 'videoBox3';
var noonerTitles = [
@ryarwood
ryarwood / player-feed.php
Last active February 3, 2016 17:30
Using a custom field to populate a custom post loop.
<?php $newsFeed = the_field('player_feed'); ?>
<?php query_posts('showposts=10&category_name='.$newsFeed.'&ignore_sticky_posts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<?php endwhile; wp_reset_query(); ?>
@ryarwood
ryarwood / header-example.php
Created December 2, 2015 23:54
Wordpress ACF Image Backup
<?php
$featured_image = get_field('post_featured_image');
if( $featured_image ) {
echo '<img src="'.$featured_image.'" class="stretch" />';
} else {
echo '<img src="'.get_bloginfo('template_url').'/images/news/default.jpg" class="stretch" />';
}
@ryarwood
ryarwood / catalog.xml
Created October 19, 2015 17:29
Add CSS & JS to Magento XML Field
<!-- To add a CSS file residing in the skin CSS folder -->
<default>
<reference name="head">
<action method="addCss">
<stylesheet>css/custom.css</stylesheet>
</action>
</reference>
</default>
@ryarwood
ryarwood / ghetto-crossthru.css
Created July 22, 2015 07:28
Quick little 45 degree strikeout background. Doesn't really look that great.
background-image: -o-linear-gradient(-45deg , rgb(63,63,63) 50%, rgb(137,137,137) 50%, rgb(63,63,63) 50.5%);
background-image: -moz-linear-gradient(-45deg , rgb(63,63,63) 50%, rgb(137,137,137) 50%, rgb(63,63,63) 50.5%);
background-image: -webkit-linear-gradient(-45deg , rgb(63,63,63) 50%, rgb(137,137,137) 0%, rgb(63,63,63) 50.5%);
background-image: linear-gradient(-45deg , rgb(63,63,63) 50%, rgb(137,137,137) 50%, rgb(63,63,63) 50.5%);
@ryarwood
ryarwood / wordpress.gitignore
Last active August 29, 2015 14:17
Wordpress .gitignore
## OS and Utility Stuff ##
#==================#
# OS Files #
#==================#
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
@ryarwood
ryarwood / preloader.js
Last active February 16, 2016 23:05
Simple jquery based pre-loader
$(document).ready(function () {
"use strict"
//indexOf is not supported by IE9>.
if (!Array.prototype.indexOf){
Array.prototype.indexOf = function(elt /*, from*/){
var len = this.length >>> 0;
var from = Number(arguments[1]) || 0;
from = (from < 0)
? Math.ceil(from)