##Theorem:
Given fmap id = id:
fmap f . fmap g = fmap (f . g)To prove this we're going to need a few lemmas:
##Theorem:
Given fmap id = id:
fmap f . fmap g = fmap (f . g)To prove this we're going to need a few lemmas:
| require 'json' | |
| require 'verkehr/zookeeper' | |
| module Verkehr | |
| class Brokers | |
| Broker = Struct.new(:id, :host, :port) do | |
| def to_s | |
| "#{host}:#{port}" | |
| end |
| # chruby-exec 2.1.2 -- ruby y.rb | |
| {:a=>:foo} | |
| # chruby-exec 2.1.3 -- ruby y.rb | |
| y.rb:2: syntax error, unexpected modifier_if | |
| a: if true; :foo; end | |
| ^ | |
| y.rb:2: syntax error, unexpected keyword_end, expecting end-of-input |
| # This is an example of the Stack Exchange Tier 1 HAProxy config | |
| # The only things that have been changed from what we are running are: | |
| # 1. User names have been removed | |
| # 2. All Passwords have been remove | |
| # 3. IPs have been changed to use the example/documentation ranges | |
| # 4. Rate limit numbers have been changed to randome numbers, don't read into them | |
| userlist stats-auth | |
| group admin users $admin_user | |
| user $admin_user insecure-password $some_password |
| module FizzBuzz | |
| -- Dependently-typed FizzBuzz, about 5 years late to the party. | |
| -- A specification of the problem. Each constructor tells the conditions | |
| -- under which it can be applied, and the "auto" keyword means that proof | |
| -- search will be used in the context where they are applied to fill them | |
| -- out. For instance, applying `N` to some Nat fails unless there's a proof in | |
| -- scope that the argument meets the criteria. | |
| data FB : Nat -> Type where |
| This is a preview of Tom Ellis' database query library for Haskell. | |
| > {-# LANGUAGE Arrows, FlexibleContexts #-} | |
| > -- TODO: Get rid of FlexibleContexts if we ever move the definition of s | |
| > -- elsewhere. | |
| > {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} | |
| > {-# LANGUAGE TemplateHaskell #-} | |
| > | |
| > module Karamaan.Opaleye.Examples where | |
| > |
| RATE_LIMIT_SCRIPT = r''' | |
| local now = tonumber(ARGV[1]) | |
| local required = tonumber(ARGV[2]) | |
| local rate = tonumber(ARGV[3]) | |
| local per_secs = tonumber(ARGV[4]) | |
| local do_subtract = tonumber(ARGV[5]) == 1 | |
| local full_at = tonumber(redis.call('GET', KEYS[1])) or 0 | |
| local score, result | |
| if full_at < now then | |
| score = rate |
| # Original Rails controller and action | |
| class EmployeesController < ApplicationController | |
| def create | |
| @employee = Employee.new(employee_params) | |
| if @employee.save | |
| redirect_to @employee, notice: "Employee #{@employee.name} created" | |
| else | |
| render :new | |
| end |
Find it here: https://github.com/bitemyapp/learnhaskell
A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E
GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).