Skip to content

Instantly share code, notes, and snippets.

Richard Hulse rhulse

View GitHub Profile
View Duration Markup
<!--
The following is recommended markup for duration.
This improves the rendering in screen readers
-->
<span class="dur"><span aria-hidden="true">(</span><span class="visually-hidden">. duration </span> 7<span aria-hidden="true">&#8242;</span> 29<span aria-hidden="true">&#8243; )</span></span>
@rhulse
rhulse / wbench.txt
Last active Aug 29, 2015
Benchmarks of NZ Media sites
View wbench.txt
Licence terms: http://creativecommons.org/licenses/by-sa/3.0/nz/
This was done via a Vodaphone cable (ex Telstra) connection in Lower Hutt, New Zealand
http://www.speedtest.net/my-result/3790128466
I did this last year on Sunday July 14 2013 if you want to compare results: https://gist.github.com/rhulse/5992832
The rationale of the test was to see if we (Radio NZ) are improving over time (we do lots of internal testing) and as against other media sites.
In couple of weeks www.radionz.co.nz is getting a couple of big performance upgrades (more details on this later) and this data will serve as a benchmark to see how much we've improved.
@rhulse
rhulse / wbench.txt
Created Jul 14, 2013
Raw data from wbench tests of media websites in New Zealand
View wbench.txt
Licence terms: http://creativecommons.org/licenses/by-sa/3.0/nz/
This was done via a Vodaphone cable (ex Telstra) connection in Lower Hutt, New Zealand
http://www.speedtest.net/my-result/2835224438
Testing http://www.radionz.co.nz/
At Sun Jul 14 13:04:07 2013
10 loops
Fastest Median Slowest Std Dev
View testcase.css
p{ font-size: 20px;}
@media print {
/* text be gone */
.removeforprint{display:none}
}
@rhulse
rhulse / formtastic_extentions.rb
Created Jun 16, 2011
Formtastic 2.0 custom input upgrade examples
View formtastic_extentions.rb
# This file contains custom input method from formtastic 1.2 and their
# replacement classes in 2.0
module FormtasticExtensions
class WysiwygInput < Formtastic::Inputs::TextInput
def input_html_options
wysiwyg_type = input_options.delete(:controls)
@rhulse
rhulse / gist:971362
Created May 13, 2011
Version 3 of the parser
View gist:971362
# This code is for illustrative purposes only and should be read in conjunction
# with this blog post:
# http://richardhulse.blogspot.com/2011/05/rebuilding-radio-nz-part-6-schedules.html
# This code is released under an MIT license (the same as Rails).
class NationalScheduleParser < Parser
def self.parse!(html)
@rhulse
rhulse / gist:971350
Created May 13, 2011
Version 1 of the parser
View gist:971350
<?php
// name richtextparser.inc
// This code is license GPL version 2
// It is an example from the blog series rebuilding radionz.co.nz
// http://richardhulse.blogspot.com/
/* VERSION HISTORY
@rhulse
rhulse / gist:971345
Created May 13, 2011
ELF Schedule Importer
View gist:971345
# This code is for illustrative purposes only and should be read in conjunction
# with this blog post:
# http://richardhulse.blogspot.com/2011/05/rebuilding-radio-nz-part-6-schedules.html
require 'open-uri'
require 'html_parser_docs'
namespace "migrate" do
desc "Fetch the remote files"
@rhulse
rhulse / recipe_import.rb
Created Apr 30, 2011
Recipe importer for ELF
View recipe_import.rb
# This code is for illustrative purposes only and should be read in conjunction
# with this blog post:
# http://richardhulse.blogspot.com/2011/04/rebuilding-radio-nz-part-4-content.html
# I was still learning Rails and Ruby at the time this was written,
# so it is a but rough and ready.
# This code is released under an MIT license (the same as Rails).
View html_parser_docs.rb
# This code is used to 'line parse' schedules that are create in MS Word.
# It build on the gist http://gist.github.com/552955
# Once the HTML is cleaned up in core, it is passed into a class
# based on the type of document.
# Each class works through a schedule document line-by-line, determining
# the context - what is the day and event
# These events are stored and imported into the main CMS.
You can’t perform that action at this time.