Skip to content

Instantly share code, notes, and snippets.

@mverzilli
mverzilli / tdd_diary.rb
Last active January 4, 2016 00:29
Diary of the development of a new feature using TDD
# Day 1, 12:00pm
# In facility_xml_generator_spec.rb, which tests the entry point for the feature I'm adding,
# I wrote a Given-When-Expect structured natural language description of my understanding of what it means for the feature to be there.
# The only piece of code so far is the construction of the SUT and a tentative name for the method that provides the
# functionality without any params.
describe 'Coded Types generation' do
it '' do
# Given that CSD codedType semantics are added to an RM's single option field by adding the metadata below to it:
# CSDType => 'codedType', codingSchema => 'foo'
@mverzilli
mverzilli / gist:a54b3b475d2b6741d78d
Created August 6, 2014 16:52
Error while bundle install'ing
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/mverzilli/.rbenv/versions/1.9.3-p484/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
checking for strlcpy() in string.h... yes
creating Makefile
make
compiling binary_protocol_accelerated.c
compiling bytes.c
#Instead of this:
require "sdl2/sdl2"
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
SDL2.init
window = SDL2.create_window("SDL Tutorial", LibSDL2::WINDOWPOS_UNDEFINED, LibSDL2::WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, LibSDL2::WINDOW_SHOWN)
#Instead of this:
require "sdl2/sdl2"
SCREEN_WIDTH = 1280
SCREEN_HEIGHT = 720
SDL2.init
window = SDL2.create_window("SDL Tutorial", LibSDL2::WINDOWPOS_UNDEFINED, LibSDL2::WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, LibSDL2::WINDOW_SHOWN)
@mverzilli
mverzilli / csd_org.txt
Last active August 29, 2015 14:07
Mapping a CSD organization
La metadata que tiene (*) Tiene que repetirse en todos los campos de ahí para abajo en la jerarquía del modelo.
Los entries con value='' admiten cualquier valor, no hace falta que sean empty.
## Organization
CSDOrganization => XXX (*)
## OID (Text)
CSDAttributeFor => CSDOrganization
CSDAttribute => oid
@mverzilli
mverzilli / csd_addresses.txt
Created October 2, 2014 15:08
How to map a subset of fields in a RM collection to a CSD Facility Address
## Addresses
For each address line, a Text Field with this metadata
CSDAddress => ''
CSDChildOf => CSDFacility
CSDCode => XXX (For example, "Legal", see page 89)
CSDComponent => YYY (One of: "StreetAddress", "City", "Province", "Country", "PostCode", see page 89)
## Contacts
CSDType => contact (*)
CSDCode => XXX (*)
## Names
CSDName => YYY (*)
CSDChildOf => CSDContact (*)
## Forename
CSDForename => ''
## Contact points
CSDType => "contactPoint" (*)
CSDCode => XXX (*)
## For each contact point text field (see page 95)
CSDContactData => YYY (one of: "equipment", "purpose", "certificate")
## Facility Operating hours
CSDOperatingHours => XXX (*)
CSDChildOf => CSDFacility (*)
## Open flag (Yes/No field)
CSDOpenFlag => ''
## Day of the week (Integer, Sunday=0, Monday=1, ...)
CSDDayOfTheWeek => ''
@mverzilli
mverzilli / pi.elm
Created February 28, 2015 16:02
Estimando PI con Montecarlo y Elm
import List (..)
import Random (pair, float, generate, Seed, initialSeed)
import Signal
import Time (every, millisecond, Time)
import Graphics.Collage (collage, Form, filled, circle, move, toForm)
import Graphics.Element (Element)
import Color (..)
import Window (dimensions)
import Text
import String