Skip to content

Instantly share code, notes, and snippets.

View Ravenna's full-sized avatar

Ravenna Ravenna

View GitHub Profile
$(".row.related-item").hover(function() {
el = $(this);
itemDesc = $(this).find('p.related-item-content');
timeoutId = setTimeout(function() {
itemDesc.stop().slideToggle('fast', 'swing');
}, 900);
}, function(){
clearTimeout(timeoutId);
itemDesc.stop().slideToggle('fast', 'swing');
});
// FADEOUT THE LOADING GRAPHIC AFTER WAITING 1 SEC
function fadeSpinner(){
$('.delay-spinner').delay(1000).fadeToggle(500, 'easeOutQuart');
}
// FADEIN THE CONTENT
function fadeInContent(type){
$('.ps-item-content .'+type+'').fadeToggle(700, 'easeInQuart');
}
switch (contentType)
{
<script>
FB.init({appId: "252314034891861", status: true, cookie: true});
function addToPage() {
// calling the API ...
FB.ui(
{
method: 'pagetab'
},
jQuery('.shelf li img').mouseover(function(){
jQuery(this).stop().animate({"width": "130px", "height": "168", "left":"-25px"}, 200);
}).mouseout(function(){
jQuery(this).stop().animate({"width": "100px", "height": "129px", "left":"0px"}, 200);
});;
jQuery(".shelf li img").live("mouseover", function () { PaperShare.Shelf.ShowDetail(this) });
var parent = document.getElementById("shelf-detail");
if (!parent.addEventListener) {
parent.attachEvent("onmouseout", PaperShare.Shelf.HideDetail(parent), true);
@Ravenna
Ravenna / pricepredicate.rb
Created May 18, 2012 16:41
PricePredicate
class PricePredicate
def initialize(&block)
@predicate = block
end
def evaluate(subject) #would I pass the lead object in here?
@predicate.call(subject) #and here
end
@Ravenna
Ravenna / gist:2206220
Created March 26, 2012 16:13
Product#new
<% content_for :javascripts do %>
<script>
$(function() {
$( "#add_photo" ).sortable();
$( "#add_photo" ).disableSelection();
});
</script>
<% end %>
@Ravenna
Ravenna / gist:2143867
Created March 21, 2012 02:37
checkbox feature
<?php
$featured_query = new WP_Query(
array(
'post_type' => 'artist',
'post_per_page' => '3',
'meta_key' => 'featured',
'orderby' => 'meta_value',
'order' => 'DESC',
'meta_query' => array(
@Ravenna
Ravenna / gist:2081340
Created March 18, 2012 21:10
Product#Edit
<% content_for :javascripts do %>
<script>
$(function() {
$( "#add_photo" ).sortable();
$( "#add_photo" ).disableSelection();
});
</script>
<% end %>
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once( get_template_directory(). '/class.gaparse.php' );
$aux = new GA_Parse($_COOKIE);
echo "Campaign source: ".$aux->campaign_source."<br />";
echo "Campaign name: ".$aux->campaign_name."<br />";
@Ravenna
Ravenna / approval.rb
Created January 13, 2012 17:12
associate method
def associate_correct_user
new_user = User.find_or_create_by_email self.email do |u|
user = Email.find_by_email(self.email)
u.first_name = user.first_name
u.last_name = user.last_name
u.invite!
end