This file contains hidden or 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
def convert_date_to_maori(date_string) | |
tereo_date = date_string.clone | |
h = { | |
/January/ => 'Kohi-tātea', | |
/February/ => 'Hui-tanguru', | |
/March/ => 'Poutū-te-rangi', | |
/April/ => 'Paengawhā-whā', | |
/May/ => 'Haratua', | |
/June/ => 'Pipiri', | |
/July/ => 'Hōngongoi', |
This file contains hidden or 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
# This code is designed to cleanup Word HTML to a very great extent. | |
# It is used at Radio NZ to cleanup documents created in Word prior to | |
# parsing them, line by line, to extract content. | |
# The Word content is pasted into WYSIWYG which is then HTTP POSTed into | |
# the app where the string is cleaned by this code. | |
# We add new lines after block elements because the next stage is a line-based | |
# parser |
This file contains hidden or 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
# 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. |
This file contains hidden or 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
# 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). | |
This file contains hidden or 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
# 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" |
This file contains hidden or 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
<?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 |
This file contains hidden or 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
# 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) |
This file contains hidden or 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
# 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) |
This file contains hidden or 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
p{ font-size: 20px;} | |
@media print { | |
/* text be gone */ | |
.removeforprint{display:none} | |
} |
This file contains hidden or 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
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 |
OlderNewer