Skip to content

Instantly share code, notes, and snippets.

View bishopandco's full-sized avatar
😈
CRUSHMODE

Michael Bishop bishopandco

😈
CRUSHMODE
View GitHub Profile
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>]]
Spree::OrdersController.class_eval do
before_filter :my_action
def my_action
logger.debug "hey look at me!"
end
end
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
<!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>
@bishopandco
bishopandco / index.html
Created December 5, 2012 01:39 — forked from mbostock/.block
Curved textPath
<!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>
@bishopandco
bishopandco / .vimrc
Created October 9, 2012 01:33
My vimrc
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
@bishopandco
bishopandco / message_theme.rb
Created September 6, 2012 03:00
Message Theming
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)
@bishopandco
bishopandco / map.js
Created June 27, 2012 17:18
Google Map Theme
[
{
featureType: "road",
stylers: [
{ visibility: "simplified" }
]
},{
featureType: "poi.park",
elementType: "labels",
stylers: [
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
# will look in db/seeds/admin_users.rb
plant :admin_users
# block syntax
plant :about_us do |seed|
seed.path = 'db/seeds/some_folder'
end