= Testing embedding the Birth Choice image on a Baby Centre site.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'curb' | |
require 'openssl' | |
require 'nokogiri' | |
cert_path = "/Users/sinclp01/.certificates/dev.pem" | |
certificate = File.read(cert_path) | |
curb = Curl::Easy.new | |
curb.cert = cert_path | |
curb.cert_key = cert_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'instagram' | |
require 'pp' | |
Instagram.configure do |config| | |
config.client_id = 'your-client-id-goes-here' | |
config.proxy = ENV['http_proxy'] if ENV['http_proxy'] | |
end | |
p Instagram.tag '6musictshirtday' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Radio TV</title> | |
<script src="require.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
bbcRequireMap = { | |
'jquery-1' : 'http://static.bbci.co.uk/frameworks/jquery/0.1.8/sharedmodules/jquery-1.6.2', | |
'swfobject-2' : 'http://static.bbci.co.uk/frameworks/swfobject/0.1.3/sharedmodules/swfobject-2', | |
'demi-1' : 'http://static.bbci.co.uk/frameworks/demi/0.9.8/sharedmodules/demi-1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'json' | |
require 'date' | |
require 'pp' | |
brand_pids = ['b0100rp6', 'b0072lb2', 'b006tmr6', 'b01mrh21', 'b006wr19'] | |
brand_pids.each do |brand_pid| | |
now = Time.now | |
url = "http://www.bbc.co.uk/programmes/#{brand_pid}/episodes/#{now.year}/#{now.month}.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
module CodeRay | |
module Encoders | |
class Prawn < Encoder | |
NBSP = ' ' | |
register_for :prawn | |
def text_token text, kind | |
text.gsub!('<', '<') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'prawn' | |
dir = '../music-example' | |
files = Dir.glob("#{dir}/*") + Dir.glob("#{dir}/**/*") | |
pdf = Prawn::Document.new(:page_size => 'A4') | |
pdf.font "Courier" | |
stats = { :files => 0, :lines => 0, :chars => 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'jsonpath' | |
require 'pp' | |
# TODO: is there a cleaner way of doing this? | |
class Capybara::Driver::Mechanize < Capybara::Driver::RackTest | |
def post_body(url, body, headers = {}) | |
if remote?(url) | |
process_remote_request(:post, url, body, headers) | |
else | |
register_local_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require "bundler/setup" | |
require 'ruby-processing' | |
require 'logger' | |
require 'tweetstream' | |
require 'yaml' | |
require 'ostruct' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--#set var="has_video" value="1"--> | |
<!--#if expr="$has_video=1" --> | |
<!--#config timefmt="%H%M" --><!--#set var="c5_time" value="${DATE_LOCAL}" --> | |
<!-- TESTING <!--#echo var="c5_time"--> --> | |
<!--#if expr="(${c5_time} >= 2000 && ${c5_time} < 2100)" --> | |
<!-- 20:00 - 21:00 --> | |
<!--#set var="video0_pid" value="bbc_three"--> | |
<!--#set var="video0_title" value="BBC Three"--> |
NewerOlder