Skip to content

Instantly share code, notes, and snippets.

View metade's full-sized avatar

Patrick Sinclair metade

View GitHub Profile
@metade
metade / index.html
Created March 3, 2014 10:48
Local Birthchoice Widget
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Where to give birth - BabyCentre</title><meta content="Hospital or home birth? Our comprehensive guides will help you make the right decision for you. Find out more. - BabyCentre" name="description"/><meta content="hospital birth, home birth, birth choices, labour and birth" name="keywords"/><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<!-- thirdPartyIncludes -->
<!-- Begin comScore Tag -->
<script>var _comscore=_comscore||[];var bcComscoreAccount='6035600';_comscore.push({c1:"2",c2:bcComscoreAccount});(function(){var s=document.createElement("script"),el=document.getElementsByTagName("script")[0];s.async=true;s.src=(document.location.protocol=="https:"?"https://sb":"http://b")+".scorecardresearch.com/beacon.js";el.parentNode.insertBefore(s,el);})();</script>
<noscript>
<img src="http://b.scorecardresearch.com/
namespace :spree do
task destroy_duplicate_shipments: :environment do
# These are the orders with duplicate shipments
orders = Spree::Order.
select("spree_orders.id, spree_orders.number").
joins(:shipments).
group("spree_orders.id, spree_orders.number").
having("COUNT(spree_shipments.id) > 1")
orders.each do |order|
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix mo: <http://purl.org/ontology/mo/> .
@prefix po: <http://purl.org/ontology/po/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix timeline: <http://purl.org/NET/c4dm/timeline.owl#> .
@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
require 'rubygems'
require 'open-uri'
require 'hpricot'
require 'addressable/uri'
require 'feed-normalizer'
require 'rdelicious'
class DeliciousMusicNews
def initialize(username, password)
@links_to_gids = links_to_gids
require 'rubygems'
require 'feedalizer'
def six_music_hub
url = "http://www.bbc.co.uk/6music/events/hub/index.shtml"
f = feedalize(url) do
feed.title = "BBC 6 Music Hub Sessions"
feed.description = "Live sessions on BBC 6 Music"
scrape_items("a.watch") do |rss_item, html_element|
require 'rubygems'
require 'logger'
require 'IRC'
Thread.abort_on_exception = true
log = Logger.new('wikipedia_stats/en_wikipedia.log', 'daily')
bot = IRC.new('wiki-stats', 'irc.wikimedia.org', '6667')
IRCEvent.add_callback('endofmotd') { |event| bot.join('#en.wikipedia') }
IRCEvent.add_callback('privmsg') do |event|
require 'rubygems'
require 'open-uri'
require 'hpricot'
require 'json'
require 'rena'
require 'rdelicious'
def get_pids_in_schedule(url)
schedule = JSON.parse(open(url).read)
%h1 rdfa testing in haml
%div{ 'xmlns:dc' => "http://purl.org/dc/elements/1.1/" }
%h2{ :property => "dc:title" } The trouble with Bob
%h3{ :property => "dc:creator" } Alice
%div{ :about => "/alice/posts/jos_barbecue" }
%h2{ :property => "dc:title" } The trouble with Bob
%h3{ :property => "dc:creator" } Alice

Ramesh Jain - Keynote

  • Semantic Gap for users (bits, chars, lists -> events/objects, concepts)
  • Data and users: triangle
  • Semantic gap exists in text too - search engines do little beyond string matching
  • Semantic web tools help, much still to do
  • Life - events, experiences and multimedia: eventweb
  • Lots of multimedia - raises problems
  • Multimedia semantics: many approaches
  • Content-based: different model layers (data -> concepts)
<h1>Editing dot's needs </h1>
<form action="/users/dot/needs" class="edit_user" id="edit_user_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="f2f0a71eecc65ae0827b545eae18d84ddb7ef72e" /></div>
<ul>
<li><input id="user_need_ids_83" name="user[need_ids][]" type="checkbox" value="83" />Doing everyday things
<ul>
<li><input id="user_need_ids_84" name="user[need_ids][]" type="checkbox" value="84" />Getting up and going to bed</li>