<%= f.input :state, :collection => ['SA', 'WA'] %>
<%= f.input :state,
:as => :radio_buttons,
:collection => ['SA', 'WA'],
23inhouse@gmail.com | |
swift code exemplifying sandy metz style duck types | |
Sure, here's an example of a Swift code that uses duck typing, in a style similar to that of Sandi Metz: | |
swift | |
Copy code | |
protocol Quackable { | |
func quack() -> String | |
} |
// TL;DR: look at this cool thing in swift | |
let ibsTags = try ibsTagRecords().reduce(into: [Int64: [Int64]]()) { | |
// this line here | |
$0[$1.ibsID, default: []].append($1.tagID) | |
} | |
// V1 original |
class RawOSMDataTests: QuickSpec { | |
override func spec() { | |
context("given a RawOSMData") { | |
var subject: () -> RawOSMData? = { return nil } | |
describe(".decode") { | |
var json: String? = "" | |
afterEach { json = nil } | |
beforeEach { |
TL;DR The plan is to use protobuf for the format. Message calls should be made with gRPC when the client wants a response. High level messages should also be published to the bus. Message calls (events) that don't require a response can just be published to the bus.
The message format must be statically typed, binary, good adoption and have RPC integration.
# cache digest talk | |
# | |
# There are 2 hard problems in computer science: caching, naming, and off-by-1 errors | |
# | |
# Gemfile | |
gem 'cache_digests' |
https://github.com/plataformatec/simple_form
http://railscasts.com/episodes/234-simple-form-revised
# Gemfile
gem 'simple_form'
require 'mechanize' | |
require 'csv' | |
CSV.foreach('wineries.csv', "r") do |row| | |
puts row.first | |
end |