Skip to content

Instantly share code, notes, and snippets.

View peteroome's full-sized avatar

Peter Roome peteroome

View GitHub Profile
# 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
@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>
@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);
// 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')
<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>
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_configh-mysql-config=/usr/local/mysql/bin/mysql_co
@peteroome
peteroome / pias_support_large
Created August 9, 2011 13:22
Support PIAS & Independent Music
<p><a href="http://goo.gl/gkRvx"><img src="http://thefourohfive.com/images/pias/pias_support_large.jpg" target="_blank" alt="Support PIAS and independent Music" width="466" height="96" /></a></p>
@peteroome
peteroome / bash_completion
Created September 19, 2011 09:33
Git Bash Autocompletion OS X Terminal Prompt
# Set git autocompletion and PS1 integration
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
GIT_PS1_SHOWDIRTYSTATE=true
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
@peteroome
peteroome / Gemfile
Created December 3, 2011 11:57
Gemfile Sqlite Problem
source :rubygems
gem 'rails', '3.1.0'
gem 'rake', '0.8.7'
gem 'pg'
gem 'authlogic'
gem "grackle", '~> 0.1.10'
gem "will_paginate", "~> 3.0"
gem 'delayed_job'
gem 'hpricot'
@peteroome
peteroome / application.css
Created February 6, 2012 16:47
Example manifest file
/*
*= require bootstrap
*/
/* rest of file omitted */