Skip to content

Instantly share code, notes, and snippets.

View daltonrooney's full-sized avatar

Dalton Rooney daltonrooney

View GitHub Profile
@daltonrooney
daltonrooney / portfolio-slideshow-min.js
Created August 6, 2011 11:41
Portfolio Slideshow custom
(function(a){a.fn.touchwipe=function(c){var b={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(c){a.extend(b,c)}this.each(function(){var e;var d;var i=false;function h(){this.removeEventListener("touchmove",f);e=null;i=false}function f(m){if(b.preventDefaultEvents){m.preventDefault()}if(i){var j=m.touches[0].pageX;var n=m.touches[0].pageY;var l=e-j;var k=d-n;if(Math.abs(l)>=b.min_move_x){h();if(l>0){b.wipeLeft()
}else{b.wipeRight()}}else{if(Math.abs(k)>=b.min_move_y){h();if(k>0){b.wipeDown()}else{b.wipeUp()}}}}}function g(j){if(j.touches.length==1){e=j.touches[0].pageX;d=j.touches[0].pageY;i=true;this.addEventListener("touchmove",f,false)}}if("ontouchstart" in document.documentElement){this.addEventListener("touchstart",g,false)}});return this}})(jQuery);jQuery(document).ready(function(a){a(window).load(function(){var g,e,c,b,f;currSlide=new Array();tabSlide=new Array();g=portfolioSlideshowOptions.psLoader;
e=port
(function(a){a.fn.touchwipe=function(c){var b={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:true};if(c){a.extend(b,c)}this.each(function(){var e;var d;var i=false;function h(){this.removeEventListener("touchmove",f);e=null;i=false}function f(m){if(b.preventDefaultEvents){m.preventDefault()}if(i){var j=m.touches[0].pageX;var n=m.touches[0].pageY;var l=e-j;var k=d-n;if(Math.abs(l)>=b.min_move_x){h();if(l>0){b.wipeLeft()
}else{b.wipeRight()}}else{if(Math.abs(k)>=b.min_move_y){h();if(k>0){b.wipeDown()}else{b.wipeUp()}}}}}function g(j){if(j.touches.length==1){e=j.touches[0].pageX;d=j.touches[0].pageY;i=true;this.addEventListener("touchmove",f,false)}}if("ontouchstart" in document.documentElement){this.addEventListener("touchstart",g,false)}});return this}})(jQuery);jQuery(document).ready(function(g){var f,d,b,a,e;currSlide=new Array();tabSlide=new Array();f=portfolioSlideshowOptions.psLoader;d=portfolioSlideshowOptions.psHas
@daltonrooney
daltonrooney / gist:1153929
Created August 18, 2011 12:05
Portfolio Slideshow 1.2.1 alt stylesheet
.portfolio-slideshow {
z-index: 0 !important
}
div.slideshow-wrapper {
visibility: hidden;
margin:0 0 10px 0;
}
/* clearfix */
@daltonrooney
daltonrooney / gist:1356238
Created November 10, 2011 21:10
Haiku custom
$('.player-container').css('visibility', 'visible').show();
/*Text Version*/
$("div[id^=haiku-text-player]").each(function() {
var num = this.id.match(/haiku-text-player(\d+)/)[1];
var ctrlId = "div#text-player-container" + num + " ul#player-buttons" + num;
var audioFile = $(ctrlId + " li.play a").attr("href");
$(this).jPlayer({
@daltonrooney
daltonrooney / gist:1377486
Created November 18, 2011 19:23
Proper way to load WordPress scripts (should be in functions.php)
<?php
function xx_load_scripts() {
wp_enqueue_script( 'jquery' );
wp_register_script( 'cycle', plugins_url( 'js/jquery.cycle.all.min.js', dirname(__FILE__) ), false, '2.99', true );
wp_enqueue_script( 'cycle' );
}
add_action('wp_enqueue_scripts', 'xx_load_scripts');
?>
@daltonrooney
daltonrooney / gist:1441149
Created December 7, 2011 02:27
Simple template for embedded slideshows
<?php
/*
/* Template Name: Gallery slideshow
/*
*/
?>
<?php get_header();?>
@daltonrooney
daltonrooney / gist:1623195
Created January 16, 2012 21:46
PSP 1.5.4 custom js
/*!
* touchSwipe - jQuery Plugin
* http://plugins.jquery.com/project/touchSwipe
* http://labs.skinkers.com/touchSwipe/
*
* Copyright (c) 2010 Matt Bryson (www.skinkers.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* $version: 1.2.3
*/
@daltonrooney
daltonrooney / gist:1676097
Created January 25, 2012 12:44
PSP 1.5.4 custom js
/*!
* touchSwipe - jQuery Plugin
* http://plugins.jquery.com/project/touchSwipe
* http://labs.skinkers.com/touchSwipe/
*
* Copyright (c) 2010 Matt Bryson (www.skinkers.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* $version: 1.2.3
*/
@daltonrooney
daltonrooney / gist:1683831
Created January 26, 2012 17:08
Custom menus for Xsilva Lightspeed
<?php function print_childs($categ, $catid){
$childs = $categ->categ_childs;
if( !$childs || ( count( $childs ) == 0 ) ){
return;
}
foreach($childs as $category){
@daltonrooney
daltonrooney / gist:1737771
Created February 4, 2012 13:08
WordPress function - redirect all non-logged-in users to the login page.
<?php
/* Redirect all non-logged-in users to the login page (private site). Add to functions.php. */
function admin_redirect() {
if ( !is_user_logged_in()) {
wp_redirect( home_url('/wp-admin/') );
exit;
}
}