Skip to content
def display_date_or_range(event, sup = true, html = true, short = false)
return if event.start_date.blank? and event.end_date.blank?
if event.single_day?
if short
out = event.start_date.strftime("%b")
else
out = event.start_date.strftime("%B")
end
out << " "

2010 UK General Election Results

D3 flavoured demo of electionmap.

require 'sequel'
require 'sqlite3'
puts "Using SQLite3 #{SQLite3::VERSION}"
db = Sequel.connect('sqlite:/')
db.create_table!(:things) do
column :email, :varchar, unique: true
end
begin
dataset.insert(attributes)
rescue Sequel::DatabaseError => exception
if exception.message =~ /\b((column \w+ is|columns .+ are) not unique|duplicate key value violates unique constraint)\b/
raise SomeOtherException
else
raise exception
end
end
class ProfilePresenter
def initialize(user, photo_url)
@user, @photo_url = user, photo_url
end
def title
@user.full_name
end
def member_since
def customers
line_items.map { |item| item.order.user_id }
end
require 'date'
require './presenter'
class MonthSelect < Presenter
def initialize(attrs = {})
@attrs = attrs.to_hash
end
def html
def format(seconds)
'%d:%02d' % seconds.divmod(60)
end
puts format(200)
puts format(121)
Something went wrong with that request. Please try again.