View uninitialized constant MemCache (NameError) fix rails 2.3.2
config.after_initialize do | |
Workling::Remote.dispatcher = Workling::Remote::Runners::StarlingRunner.new | |
end |
View Factory Girl and cucumber
#factories setup w/ cucumber. | |
#(env.rb) | |
require 'factory_girl' | |
Before do | |
require File.join(RAILS_ROOT, 'test', 'factories') | |
end | |
#Then in your (setups.rb) you can create your object using one line. |
View Dymanic embed code from inside Flash
// load root vars setup URL and Code to copy | |
var myRoot = root; | |
var player:String = "http://cdn.cloudfiles.mosso.com/c38342/wc_video_player.swf" | |
var EmbedCode:String = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="wc_video" width="552" height="335" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'; | |
EmbedCode += '<param name="movie" value="'+ player +'" />'; | |
EmbedCode += '<param name="allowScriptAccess" value="always" />'; | |
EmbedCode += '<param name="FlashVars" value="mediaType=video&mediaSrc=' + myRoot.strSource +'&addToCanvas='+ myRoot.canvas +'&page='+ myRoot.page +'" />'; | |
EmbedCode += '<embed src="'+ player +'" quality="high" width="552" height="335" name="Example" align="middle" play="true" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="mediaType=video&mediaSrc=' + myRoot.strSource +'&addToCanvas='+ myRoot.canvas +'&page='+ myRoot.page +'"></em |
View tabs.sass
/* root element for tabs */ | |
ul.tabs | |
margin:0 !important | |
padding: 0 | |
height: 30px | |
border-bottom: 5px solid #ddd | |
/* single tab */ | |
ul.tabs li | |
float: left |
View haml detection
- content_for :js do | |
- javascript_tag do | |
var agent=navigator.userAgent.toLowerCase(); | |
var is_ipad = (agent.indexOf('ipad')!=-1); | |
if (is_ipad) { | |
$('body').css('-webkit-background-size', '1024px 1024px');} |
View iphone-jquery-hover.rb
- content_for :js do | |
- javascript_tag do | |
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) | |
||(navigator.userAgent.match(/iPad/i))) { | |
$(".nav li a").click(function(){ | |
$(".nav li a").removeClass("hover"); | |
$(this).addClass("hover"); | |
}); | |
} |
View custom_steps.rb
Given /^I visit subdomain "(.+)"$/ do |sub| | |
#host! "#{sub}.example.com" #for webrat | |
Capybara.default_host = "#{sub}.example.com" #for Rack::Test | |
Capybara.app_host = "http://#{sub}.example.com:9887" if Capybara.current_driver == :culerity | |
################################################################################ | |
# As far as I know, you have to put all the {sub}.example.com entries that you're | |
# using in your /etc/hosts file for the Culerity tests. This didn't seem to be | |
# required for Rack::Test | |
################################################################################ |
View gist:1377438
before do | |
@store ||= Factory(:capybara_store, :depot => true) | |
@order ||= Factory(:order, :state => "processed", :store_id => @store.id, :shipping_address_id => user.default_address.id, :user => user) | |
<<<<<<< HEAD | |
@item ||=Factory(:rental_item, :order => @order, :created_at => 32.days.ago, :from => 32.days.ago, :source_status => 'shipped') | |
login(user) | |
======= | |
@rental_item ||= Factory(:rental_item, :order => @order, :created_at => 32.days.ago, :from => 32.days.ago, :source_status => 'shipped') | |
>>>>>>> 6450894835d13bbca6b80cb5811f7099d4857a29 | |
end |
View gist:1643685
/* | |
Syntax error: File to import not found or unreadable: partials/base. | |
Load paths: | |
Compass::SpriteImporter | |
/Users/ntreadway/rentwb/public/stylesheets/sass | |
/Users/ntreadway/rentwb/app/assets/stylesheets | |
/Users/ntreadway/.rbenv/versions/1.8.7-p352/lib/ruby/gems/1.8/bundler/gems/compass-520df2b17331/frameworks/blueprint/stylesheets | |
/Users/ntreadway/.rbenv/versions/1.8.7-p352/lib/ruby/gems/1.8/bundler/gems/compass-520df2b17331/frameworks/compass/stylesheets | |
on line 7 of /Users/ntreadway/rentwb/app/assets/stylesheets/front_facing.css.scss |
View Select Field Styling using coffee script
$(document).ready -> | |
unless $.browser.opera | |
$("select.option_id").each -> | |
title = $(this).attr("title") | |
title = $("option:selected", this).text() unless $("option:selected", this).val() is "" | |
$(this).css( | |
"z-index": 10 | |
opacity: 0 | |
"-khtml-appearance": "none" | |
).after("<span class=\"select\">" + title + "</span>").change -> |
OlderNewer