Skip to content

Instantly share code, notes, and snippets.

View joemsak's full-sized avatar

Joe Sak joemsak

View GitHub Profile
it "should retrieve all bookings based on attributes" do
booking = Factory(:booking, :program => Factory(:program, :id => 1))
report = Factory(:report, :program_id => 1)
report.bookings.should include(booking)
end
def index
if params[:q]
@expenses = Expense.all(:select => :description, :group => :description, :conditions => "description LIKE '%#{params[:q]}%'")
else
if params[:date]
@date = Time.parse(params[:date])
@expenses = @current_user.expenses.by_date(@date).all
else
@date = Time.now.midnight
<div id="cycle_area">
<div>
<img src="img/appo.jpg" />
<h2>Appolicious</h2>
<h3>Find mobile apps you'll love</h3>
<p>Appolicious now has curated apps! As the mobile app landscape shifts and evolves, Appolicious stays on top with more app discovery features. Users can now create their own collection of applications, souping up the browsing experience. Go on, wrangle up your own set!</p>
<p><a href="http://www.appolicious.com">Visit website &#187;</a></p>
</div><!-- /one thing to cycle, loop this -->
<div>
<img src="img/abc.jpg" />
$(document).ready(function(){
$('#cycle_area').cycle({
fx: 'scrollHorz',
speed: 500,
timeout: 5500,
pager: '#pager',
pagerAnchorBuilder: buildThumbnails,
easing: 'easeInOutCubic',
pause: true
});
<script src="http://www.google.com/jsapi"></script>
<script>
google.load('jquery','1.4.2');
</script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.cycle.all.js"></script>
<script src="js/portfolio.js"></script>
/* ## Popout --------------------------------------------- */
#pop_out{
display:none;
position:absolute;
padding:10px;
background:#f6f6f6;
border:1px solid #ccc;
box-shadow:0 2px 25px #999;
-webkit-box-shadow:0 2px 25px #999;
-moz-box-shadow:0 2px 25px #999;
$('video').each(function(){
img_src = $(this).attr('poster');
height = $(this).height();
width = $(this).width();
$(this).wrap('<div class="video_wrap" style="position:relative; width:'+width+'; height:'+height+';" />');
$(this).after('<img class="video_still" src="'+ img_src +'" style="cursor:pointer; position:absolute; top:5px; left:5px; width:'+width+'; height:'+height+';" />');
});
$('.video_still').live('click', function(){
$(this).prev('video')[0].play();
#ln 43
<%= f.send(form_value_type, :value, :size => ("40x5" if form_value_type == 'text_area')) %>
#### RESOLVED ####
# ERROR is: undefined local variable or method `form_value_type'
#### RESOLVED BY: including the helper in Refinery::ApplicationHelper
def camera_rules_for(venue)
allowed, html = [], ""
allowed << "Point & Shoot" if venue.point_and_shoot
allowed << "SLR" if venue.slr
allowed << "Flash" if venue.flash
allowed.each do |rule|
html += "<li>#{rule} OK</li>"
end
source 'http://rubygems.org'
gem 'rails', '3.0.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
# Use unicorn as the web server