Skip to content

Instantly share code, notes, and snippets.

View beaucollins's full-sized avatar
🃏
Special Author

Beau Collins beaucollins

🃏
Special Author
View GitHub Profile
@beaucollins
beaucollins / gist:6628528
Last active December 23, 2015 11:29 — forked from Ravenna/gist:6616431
// FADEOUT THE LOADING GRAPHIC AFTER WAITING 1 SEC
function fadeSpinner(complete){
$('.delay-spinner').delay(1000).fadeToggle(500, 'easeOutQuart', complete);
}
// FADEIN THE CONTENT
function fadeInContent(type){
$('.ps-item-content .'+type+'').fadeToggle(700, 'easeInQuart');
}
var fadeSpinnerType = function(){
<script type="text/javascript">
$(document).ready(function() {
$('#next_approver_email_field').toggle();
$('#approval_checked').click(function() {
$('#next_approver_email_field').show();
});
});
</script>
<%= form_for @recommendation, :html => { :multipart => true} do |f| %>
<% if @recommendation.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@recommendation.errors.count, "error") %> prohibited this recommendation from being saved:</h2>
<ul>
<% @recommendation.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
@beaucollins
beaucollins / gist:1502825
Created December 20, 2011 19:19 — forked from Ravenna/gist:1502681
routes
# resources :recommendations, :has_many => :approvals
resources :recommendations, :shallow => true do
resources :approvals
end
@beaucollins
beaucollins / gist:1107264
Created July 26, 2011 17:17 — forked from anonymous/gist:1107220
functions.php
add_action( 'init', 'event_rewrites' );
function event_rewrites()
{
add_rewrite_rule( "/\/events\/day\/([\d]{4}-[\d]{2}-[\d]{2})\/?/", 'index.php?post_type=event&event-date=$matches[1]', 'top' );
}
add_filter( 'query_vars', 'event_vars' );
function event_vars ( $vars )
{
$vars[] = 'event-date';
return $vars;
@beaucollins
beaucollins / events.php
Created June 8, 2011 21:16 — forked from anonymous/events.php
events.php
<?php
$today = date("o-m-d");
$future = strtotime ( '+6 days' , strtotime ( $today ) ) ;
$future = date ( 'o-m-d' , $future );
$event_query = new WP_Query(
array(
'post_type' => 'event',
'meta_key' => 'event-date',
'orderby' => 'meta_value',
'order' => 'asc',
class Object
def if_present?(&blk)
if blk.arity == -1
instance_eval(&blk)
else
blk.call(self)
end
end
def wedgie_tws
@products = Product.find :all, :conditions => {:name_data => ['double-agent', 'nitrane-contraband', 'delta-mvmnt', 'contraband', 'bandita-contraband']}
end
# Unique for each merchant. Your merchant_group_id is located in the PowerReviews Dashboard > Merchant
# Group Properties section.
PowerReviews::Config.merchant_group_id = 11979
# ID representing your website (default value is "1"). If you have multiple websites and would like to
# integrate PowerReviews onto each site, we can set your account as a Master Merchant. This enables
# review sharing and consolidated management among your different websites. When using the “Master
# Merchant” configuration, you assign a different Site ID to each site that will have reviews. This ID
# can be your own internal ID for the site or an ID assigned by PowerReviews. If you are implementing
def results
return @results unless @results.nil?
# Strategy
# First always, consider the weight range, right now we'll find where max_weight = :weight
conditions = ['', {}]
#conditions = ["weight_range_max = :weight", {:weight => self.weight}]
# If they choose kids for intended use then just find shoes for kids and ignore gender
#
if self.intended_use == 'kids'