Peters told the Lords they should Brexit, to again look to the Reserve Bank to tell us how they're going to do themselves out of control and when is this incompetent Clark Government going to be done. No chance of that with New Zealand First, obviously there's still a lot of figures were spilling off the Tertiary Minister's printing press, the custodian of the market. No chance of that with New Zealand First, obviously there's still a lot of work to be about the crisis that they've tried unsuccessfully to get the incumbents have thrown up their hands in horror at the response their billion dollar binge on roads, power poles and sewers has been fierce with no political punches being pulled, even between MPs on the topic on Black Friday last month. Peters did stop for a breather though and was asked about his Brexit buddy Nigel Farage's resignation as the upper price it could fetch at auction.
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 'virtus' | |
require 'axiom-memory-adapter' | |
module Mementus | |
# Proof of concept for a toy ORM that combines some aspects of the | |
# ActiveRecord API with an in-memory query model based on the Axiom | |
# relational algebra API. | |
# | |
# The weirdest trick is that the data stored in the relational model |
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
/Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/support/registry.rb:26:in `block in []': nil doesn't exist in ROM::RelationRegistry registry (ROM::Registry::ElementNotFoundError) | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/support/registry.rb:26:in `fetch' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/support/registry.rb:26:in `[]' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/setup/finalize.rb:91:in `block in load_readers' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/setup/finalize.rb:90:in `each' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/setup/finalize.rb:90:in `load_readers' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/setup/finalize.rb:53:in `run!' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/setup.rb:61:in `finalize' | |
from /Users/maetl/.rvm/gems/ruby-2.1.4/gems/rom-0.6.0.beta2/lib/rom/global.rb:176:in `finalize' | |
from /Use |
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 'nokogiri' | |
require 'json' | |
POPULATION = 'List_of_countries_and_dependencies_by_population' | |
ISO_CODES = 'ISO_3166-1' | |
COUNTRY_CODES = {} | |
COUNTRIES = [] | |
def make_country(code, name, population) |
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
# spec/integration/hash_spec.rb | |
describe 'combining transformations' do | |
it 'applies functions to a struct' do | |
symbolize_keys = Transproc(:symbolize_keys) | |
map = Transproc(:map_hash, user_name: :name, user_email: :email) | |
transformation = symbolize_keys + map | |
InputUser = Struct.new(:user_name, :user_email) |
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 'transproc/all' | |
require 'addressable/uri' | |
## | |
# Convert string keys to symbols | |
# | |
transform = Transproc(:symbolize_keys) | |
data = { | |
'name' => 'Mark Rickerby', |
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 'addressable/template' | |
class Filter::RawParams | |
def initialize(params) | |
@params = params | |
end | |
def encode_value(value) | |
Addressable::URI.encode_component(value, Addressable::URI::CharacterClasses::UNRESERVED) | |
end |
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
(1..9).reduce('') do |m,i| | |
s = i.to_s | |
m << s | |
r = "#{m} * 8 + #{i.to_s}" | |
puts r + " = " + eval(r).to_s | |
m | |
end |
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 'eventmachine' | |
class Pipeline < EM::Completion | |
def initialize(*steps) | |
@steps = steps | |
@steps.each_cons(2) do |pair| | |
pair.first.callback do |input| | |
EM.next_tick do | |
pair.last.call(input) |
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 'fiber' | |
class Step | |
def initialize(source, yielder=nil) | |
@context = Fiber.new do | |
source.each do |element| | |
if yielder | |
yielder.call(element) | |
else | |
Fiber.yield(element) |