Skip to content

Instantly share code, notes, and snippets.

View snusnu's full-sized avatar

Martin Gamsjaeger snusnu

View GitHub Profile
@snusnu
snusnu / app.rb
Last active December 17, 2015 15:19
Example dummy app that uses substation, aequitas, ducktrap, anima and mustache. On rack.
require 'pp'
require 'adamantium'
require 'equalizer'
require 'concord'
require 'abstract_type'
require 'aequitas'
require 'ducktrap'
require 'anima'
require 'substation'
@snusnu
snusnu / campaign_ideas.md
Created February 22, 2013 17:10
Collecting ideas for a crowdfunding campaign for DataMapper 2

What we're building

We need to describe the overall goal we're trying to achieve with DM2, break it up into manageable small steps and come up with a realistic timeframe / amount of hours to make it happen.

How to reach out

  • Look through lanyrd and ask people we know if they can spread the word about our campaign at conferences
  • Contact popular podcasts and ask if they're willing to feature our campaign and ask people to contribute
  • changelog
@snusnu
snusnu / aliases.rb
Created December 11, 2012 04:00
minimal aliasing strategies for dm2
require 'equalizer'
require 'abstract_type'
module DataMapper
module Relation
class Graph
class Node
class Aliases
@snusnu
snusnu / gist:4027764
Created November 6, 2012 21:38
Current DM2 spec mutations
Heckle found 279 mutations that didn't cause spec violations
DataMapper::RelationRegistry::RelationNode contains the following poorly-specified methods:
- #initialize
DataMapper::RelationRegistry::RelationEdge contains the following poorly-specified methods:
- #relation
DataMapper::RelationRegistry::Builder::BaseBuilder contains the following poorly-specified methods:
- #name
@snusnu
snusnu / dm2-diagram.ly.xml
Created September 25, 2012 10:25
Save to file and open at http://www.diagram.ly
<mxGraphModel dx="1626" dy="1969" scale="0.833" grid="1" guides="1" tooltips="1" connect="1" fold="1" page="0" pageScale="1" pageWidth="826" pageHeight="1169" style="default-style2"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="46" value="" style="rounded=1" parent="1" vertex="1"><mxGeometry x="10" y="-10" width="770" height="340" as="geometry"/></mxCell><mxCell id="47" value="Address.belongs_to :user, User" style="text;fontFamily=Courier New;strokeWidth=1;fillColor=#999999;fontStyle=1" parent="1" vertex="1"><mxGeometry x="270" y="6.500000000000078" width="250" height="29" as="geometry"/></mxCell><mxCell id="48" value="" style="group;fontFamily=Courier New" parent="1" vertex="1" connectable="0"><mxGeometry x="125" y="86" width="520" height="80" as="geometry"/></mxCell><mxCell id="13" value="addresses__X__users" style="rhombus;fontFamily=Courier New" parent="48" vertex="1"><mxGeometry x="170" width="170" height="70" as="geometry"/></mxCell><mxCell id="27" value=":user" style="fontFamily=Courier
@snusnu
snusnu / dm-veritas-gateway.rb
Created June 1, 2012 10:11
Mapping DM1 resources to veritas gateways
require 'dm-core'
require 'dm-migrations'
URI = 'postgres://localhost/test'.freeze
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, URI)
class Account
include DataMapper::Resource
@snusnu
snusnu / gist:735602
Created December 10, 2010 00:57
DM relationship order bug
## Problem
Currently, relationships are stored in a hash. This means that the order in which they were created gets lost.
* A model with a composite primary key that is made up of two foreign keys (e.g. a join table)
* Only the relationships are defined (using #belongs_to)
* Properties are *not* explicitly defined (using #property)
class PersonTask
include DataMapper::Resource
PATH
remote: /Users/snusnu/projects/github/shared/datamapper/dm-core
specs:
dm-core (1.0.2)
addressable (~> 2.2)
extlib (~> 0.9.15)
PATH
remote: /Users/snusnu/projects/github/shared/datamapper/dm-do-adapter
specs:

dm-core

RUBY in_memory yaml sqlite postgres mysql
1.8.7 pass pass pass pass pass
1.9.2 pass pass pass pass pass
jruby pass pass pass pass pass
rbx fail fail fail fail fail

dm-yaml-adapter

#!/usr/bin/env ruby -Ku
# encoding: utf-8
require 'fileutils'
require 'pathname'
require 'thor'
require 'addressable/uri'
require 'ruby-github' # TODO: replace ruby-github with something better maintained