Skip to content

Instantly share code, notes, and snippets.

View paulingham's full-sized avatar

Paul Ingham paulingham

  • cinch
  • Scotland
View GitHub Profile
module GoggleBox
# require 'httparty'
module TVRage
class Show
def self.search opts={}
"searching TVRage for shows with options #{opts.inspect}"
end
end
end
def youtube_video(url, text, height, width)
altered_text = text.gsub(url,"<iframe title='YouTube video player' class='youtube-player' type='text/html' width='#{width}' height='#{height}' src='#{url}' frameborder='0'></iframe>")
end
def vimeo_video(url, text, height, width)
ident_regexp = /\/[0-9]{3,}/
url_ident = url.scan(ident_regexp).to_s
altered_text = text.gsub(url,"<p><iframe title='Vimeo Video Player' src='http://player.vimeo.com/video#{url_ident}' width='#{width}' height='#{height}' frameborder='0'></iframe></p>")
end
@paulingham
paulingham / engine.rb
Created June 24, 2009 20:30 — forked from augustl/engine.rb
Fixed the typos - ie.. divition to division
module Less
class Engine
attr_reader :css
attr_reader :parser, :build_handler, :root_node
def initialize(less)
@less = less.dup
@parser = LessGrammarParser.new
@build_handler = BuildHandler.new
parse