Counters are expected to land in Riak 1.4! See this pull-request.
h/t to @russelldb for the demo code.
-- In `f` we want to keep piping (part of) the result of one function into | |
-- another, and stop as soon as something fails | |
f :: [A] -> Either String (B, [A]) | |
f xs = | |
case f1 xs of | |
Left s -> Left s | |
Right (res1, xs') -> | |
case f2 xs' of | |
Left s -> Left s | |
Right (res2, xs'') -> |
module Main | |
import Prelude.Algebra | |
record GCounter : Type where | |
MkGCounter : (value : Int) -> GCounter | |
gcjoin : GCounter -> GCounter -> GCounter | |
gcjoin l r = (MkGCounter ((value l) + (value r))) |
Counters are expected to land in Riak 1.4! See this pull-request.
h/t to @russelldb for the demo code.
class Hello | |
def self.first | |
"Boo!" | |
end | |
private | |
def self.second | |
"Buh!" | |
end |
woop = { | |
foo: "bar", | |
qux: "baz" | |
} | |
woop.each.with_index do |(name, value), index| | |
puts "#{index}: #{name} = #{value}" | |
end |
class Chapter | |
include Mongoid::Document | |
field :position, :type => Integer | |
field :title, :type => String | |
field :identifier, :type => String | |
embedded_in :book | |
embeds_many :elements | |
def self.process!(git, file) |
def foo | |
begin | |
raise "" | |
rescue StandardError | |
p "error" | |
end | |
end | |
foo |
# Why does the first one work but not the second one? | |
> (1..10).each_with_object([]) {|i, a| a << i*2; puts a.object_id } | |
2151926500 | |
2151926500 | |
2151926500 | |
2151926500 | |
2151926500 | |
2151926500 | |
2151926500 |
Feature: Admin signing in | |
In order to modify content | |
As an admin | |
I want admin login | |
Scenario: Signing in as an admin | |
Given there is an admin with the username "[email protected]" and the password "secret" | |
When I go to the admin path | |
And I fill in "Login" with "[email protected]" | |
And I fill in "Password" with "secret" |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0.beta3' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'pg', '0.8.0' | |
gem 'inherited_resources', '1.1.2' |