Skip to content

Instantly share code, notes, and snippets.

@mayo
mayo / gist:11624
Created September 19, 2008 17:40 — forked from cilquirm/gist:11623
module MarcasDeTiempo
def self.included(base)
# Propiedades especiales
# Permite guardar la fecha y hora de eliminación del recurso
property :deleted_at, ParanoidDateTime
# Permite conocer cuándo fue creado y cuándo fue modificado el recurso
property :created_at, DateTime
property :updated_at, DateTime
end
end
have_header: checking for win32.h... -------------------- no
"mingw32-gcc -E -I. -I/usr/home/mayo/.rake-compiler/ruby/ruby-1.8.6-p287/lib/ruby/1.8/i386-mingw32 -I/usr/home/mayo/do/do_postgres/ext/do_postgres_ext -I/usr/home/mayo/do/cross/postgres-8_2_11/pgsql/include/server/port/win32 -I/usr/home/mayo/do/cross/postgres-8_2_11/pgsql/include -g -O2 conftest.c -o conftest.i"
conftest.c:1:19: error: win32.h: No such file or directory
checked program was:
/* begin */
1: #include <win32.h>
/* end */
...
#include <libpq-fe.h>
#include <postgres.h>
#include <mb/pg_wchar.h>
#include <catalog/pg_type.h>
/* Undefine constants Postgres also defines */
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
Luis@KEORE (D:\Users\Luis\projects\oss\datamapper\do.git\do_postgres\ext\do_postgres_ext)
$ ruby extconf.rb --with-pgsql-dir=d:/users/luis/projects/oss/_libs/pgsql --with-pgsql-server-include=D:/users/luis/projects/oss/_libs/pgsql/include/server --with-pgsql-win32-include=d:/users/luis/projects/oss/_libs/pgsql/include/server/port/win32
require 'rubygems'
require 'dm-core'
require 'dm-serializer'
class Test
include DataMapper::Resource
property :id, Serial
end
class User
require DataMapper::Resource
property :id, Serial
property :...
has n, :interests
has n, :questions, :through => :interests
end
b = Book.get(1)
b.latest_page #=> yields Page with id 3, as if I did Page.first(:order => [ :book_id.desc ])
#if I replace the line in latest_page with
self.pages.first(:book_id => self.id, :order => [ :created_at.desc ])
b.latest_page #=> yields Page with id 2, as expected
#if I replace the line in latest_page with
@mayo
mayo / README.md
Last active July 16, 2016 04:32 — forked from mbostock/weekday.js
Weekdays

A basic example of using mbostock's weekday.js gist to to plot only weekdays using a linear scale. The resulting charts will not show gaps where weekends would be.

@mayo
mayo / README.md
Last active August 29, 2015 14:01
Dayselect Scale

Expanding on mbostock's weekday.js and my Weekdays gists by adding adaptive tick mark format and wrapping it all up in a dayselect scale (d3.scale.dayselect).

View at bl.ocks.org;

@mayo
mayo / README.md
Last active September 26, 2017 23:09 — forked from mayo/README.md
Playground gist for bl.ocks.org

Playground gist for bl.ocks.org