Skip to content

Instantly share code, notes, and snippets.

View peteroome's full-sized avatar

Peter Roome peteroome

View GitHub Profile
<ul id="blog_months">
<% @months.each_with_index do |month, index| %>
<li class="<%= monthly_post_list_class(month) %>">
<div class="outer_month_border">
<div class="monthly_posts <%= cycle("light_outer", "dark_outer")%>">
<div class="monthly_posts_inner_bar <%= cycle("light_inner", "dark_inner")%>" style="height: <%= month_percentage_calculator(index) %>%"></div>
</div>
</div>
<%= content_tag :h5, link_to(month, articles_path(:month => (index+1))), :class => todays_month(index) %>
</li>
// application.js
$(function(){
$('body').removeClass('js-disabled').addClass('js-enabled');
$('#i_like_this').incrementILikeCount();
});
$.fn.incrementILikeCount = function() {
return this.each(function(){
var linkAction = $(this).attr('href')
@peteroome
peteroome / jquery_rotating_content_js
Created September 26, 2009 12:52
The Javascript used to make each item in the given list fade in and out.
$(function(){
$('body').removeClass('js-disabled').addClass('js-enabled');
$('#quotes').flashQuotes();
});
$.fn.flashQuotes = function(){
return this.each(function(){
var quotes = $('>li',this);
@peteroome
peteroome / jquery_rotating_content_markup
Created September 26, 2009 12:40
This is the markup that is used for the fading in and out content jquery pluign.
<ul id="quotes">
<li class="showing">
<blockquote>
<p>“…very professional, providing us with support and guidance throughout”</p>
<p><cite><img src="some_image.gif" alt="Company X" /></cite></p>
</blockquote>
</li>
<li>
<blockquote>
<p>“Simply brilliant”</p>
# Thinking Sphinx Rake Tasks
rake thinking_sphinx:start
rake thinking_sphinx:stop
rake thinking_sphinx:restart
rake thinking_sphinx:index
# Models
class Article < ActiveRecord::Base
define_index do