Skip to content

Instantly share code, notes, and snippets.

require 'will_paginate'
# patch WillPaginate to allow reverse pagination
# only do this if you're not showing the page numbers themselves
# pass option :reverse => true to reverse paginate, and don't forget to pass custom labels
class WillPaginate::LinkRenderer
def html_attributes
return @html_attributes if @html_attributes
@html_attributes = @options.except *(WillPaginate::ViewHelpers.pagination_options.keys - [:class])
Thoughts on twitter attribution
via Used when attributing link/tweet/idea to others,
but attributing tweet either quoted from
linked work (not tweet) or originally written.
Attribution in form of twitter username
or full real name.
Links gathered from twitter users to *their own*
blog or site do not require via. This

BLOCKERS

  • less verbose template code
  • authentication - basic?
  • pretty default template. 960gs? how to integrate css?

NICE TO HAVE

  • work on assignment/unassignment on manage homepage.. make everything work from one form
  • validate homepage paths for directory-ness and if the location actually exists..
<!-- three thoughts for a Homer templating DSL called 'Ho' -->
<!-- currently -->
<div id="feature">
<% feature = Ho.new(@homepage,'feature') %> <!-- 'in-slot' init -->
<%= feature.title %>
<%= feature.body %>
</div>
#!/usr/bin/env ruby
# find first followers
require 'rubygems'
require 'twitter'
begin
USERNAME = ARGV[0].to_s
curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'
#State,attribute
#California,sunshine
#California,beaches
#Texas,oil
#Texas,rock_festivals
s = TableFu.new(csv)
s.faceted_by("State").each do |state|
puts state.row
end
module Typepad
class Auth
AUTH_KEYS = File.open(File.dirname(__FILE__) + '/' + 'typepad_oauth.yml') {|y| YAML::load(y)}
CONSUMER_KEY = AUTH_KEYS['consumer_key'].to_s
CONSUMER_SECRET = AUTH_KEYS['consumer_secret'].to_s
#owner_id is application id in settings
OWNER_ID = AUTH_KEYS['owner_id'].to_s
def initialize
tpm_twitter_wire_*
# backup redis databases to s3 on the engineyard platform
require 'zlib'
require 'rubygems'
require 'crack/json'
require 'aws/s3'
class Redis2S3
DATABASE = '/db/redis/redis_state.rdb'