Skip to content

Instantly share code, notes, and snippets.

View joshnesbitt's full-sized avatar

Josh Nesbitt joshnesbitt

View GitHub Profile
# Lighter -- Campfire from the command line
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail
require "rubygems"
require "tinder"
require "readline"
require "highline/import"
class Lighter
def initialize(room)
@room = room
#!/usr/bin/env ruby
require 'rubygems'
require 'octopi'
require 'choice'
include Octopi
Choice.options do
header ''
require 'rubygems'
require 'redis'
require 'rfeedparser'
$redis = Redis.new
class Tweet < Struct.new(:tweet_id, :text, :author, :link)
def self.parse(item)
self.new("tweet/#{item['id']}", item.title, item.author.split.first, item.link)
end
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base