Skip to content

Instantly share code, notes, and snippets.

View vassilis's full-sized avatar

Vassilis Terzopoulos vassilis

View GitHub Profile
require 'rubygems'
def start_simplecov
require 'simplecov'
SimpleCov.start 'rails' unless ENV["SKIP_COV"]
end
def spork?
defined?(Spork) && Spork.using_spork?
end
module ActsAsTaggable
module Taggable
def self.included(base)
base.field :tags, :type => Array, :default => []
end
end
module Tagger
def tag(object, tags)
@vassilis
vassilis / octopress-pagination
Created August 21, 2012 19:18
Octopress Pagination
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a class="prev" href="{{paginator.previous_page}}">&larr; Prev</a>
{% endif %}
{% for page in (1..paginator.total_pages) %}
{% capture url %}/{{site.pagination_dir}}/page/{{page}}{% endcapture %}
{% if page == 1 %}
{% assign url = "/" %}
{% endif %}