Skip to content

Instantly share code, notes, and snippets.

View plusjade's full-sized avatar
🐵
🚀 🤖

Jade Dominguez plusjade

🐵
🚀 🤖
View GitHub Profile
@mudasobwa
mudasobwa / plugins-views-helpers-paginator.rb
Last active December 29, 2015 19:39
Paginator helper for ruhoh, collapsing page links when there are a lot of posts.
module Ruhoh::Views::Helpers
module Paginator
# current_page is set via a compiler or previewer
# in which it can discern what current_page to serve
def paginator
per_page = config["paginator"]["per_page"] rescue 5
current_page = master.page_data['current_page'].to_i
current_page = current_page.zero? ? 1 : current_page
offset = (current_page-1)*per_page
@douo
douo / wp_to_ruhoh.rb
Created August 21, 2012 13:07
wordpress export xml to ruhoh post
# coding: utf-8
# chcp 65001
require 'rubygems'
require 'hpricot'
require 'nokogiri'
require 'fileutils'
require 'yaml'
require 'time'
require 'pandoc-ruby'
@defunkt
defunkt / range.rb
Created November 24, 2009 21:17
Mustache method_missing hack
require 'mustache'
class Ranger < Mustache
self.template = <<-template
{{#range_0_to_10}}
<option value="{{i}}">{{i}}</option>
{{/range_0_to_10}}
template
def range(first, last)