This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
li.product_customizations.collect{|x| x.customized_product_options if x.customized_product_options.last.customizable_product_option_id == 3}.reject{|x| x == nil} | |
=> [[#<Spree::CustomizedProductOption id: 740, product_customization_id: 731, customizable_product_option_id: 3, value: "https://signaturesettings-artwork.s3.amazonaws.com/...", created_at: "2013-06-21 14:58:56", updated_at: "2013-06-21 14:58:56", customization_image: nil>]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<!--[if lte IE 8]> | |
<script type="text/javascript" src="http://webmonarch.github.com/d34raphael/d3/lib/sizzle/sizzle.js"></script> | |
<script type="text/javascript" src="http://webmonarch.github.com/d34raphael/d3/lib/ie8/compat.js"></script> | |
<![endif]--> | |
<script type="text/javascript" src="http://webmonarch.github.com/d34raphael/d3/lib/raphael/raphael.js"></script> | |
<script type="text/javascript" src="http://webmonarch.github.com/d34raphael/d3/d3.v2.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MessageTheme | |
def self.message_theming(week,year) | |
TwitterWeeklySampleMessage.primary_key="id" | |
BlogWeeklySampleMessage.primary_key="id" | |
FacebookWeeklySampleMessage.primary_key="id" | |
weekly_samples = WeeklySample.includes({:property => :tags}, :facebook_weekly_sample_messages, :blog_weekly_sample_messages, :twitter_weekly_sample_messages).where(:week_number => week,:year => year) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
class BufferedLogger | |
module Severity | |
COLORIZE = 10 | |
end | |
include Severity | |
def add(severity, message = nil, progname = nil, &block) | |
return if @level > severity | |
message = (message || (block && block.call) || progname).to_s | |
message = "\e[0;45m#{message}\e[0;0m\n" if severity == 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sign_in_out_button | |
out = [] | |
if current user | |
out << link_to "Sign out", '/logout', :class => "login_button round" | |
else | |
out << link_to "Sign in (or up)", '/login', :class => "login_button round" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Convert a mysql dump into a sqlite-compatible format. | |
# I wrote this for just one script... no guarantess that it will work with others... | |
# python fsql.py < mysqldump.sql > readyforsqlite.sql | |
import re | |
import sys | |
content = sys.stdin.read() |