Skip to content

Instantly share code, notes, and snippets.

View yannick's full-sized avatar
🏗️

Yannick Koechlin yannick

🏗️
View GitHub Profile
require 'rubygems'
require 'dm-core'
require 'spec'
require 'dm_redis_adapter'
require 'dm-validations'
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, {:adapter => "redis"})
require 'rubygems'
require 'dm-core'
require 'dm-timestamps'
require 'pp'
DataMapper.setup(:default,
:adapter => 'mysql',
:host => 'localhost',
:username => 'root',
require 'superfeedr'
require 'term/ansicolor'
include Term::ANSIColor
class String
include Term::ANSIColor
end
class Code < Ohm::Model
include Comparable
attribute :sha1
attribute :md5
attribute :filesize
attribute :mimetype
From c20276eddba27e17006385ed8c65974c1764642d Mon Sep 17 00:00:00 2001
From: Yannick Kechlin <[email protected]
Date: Sun, 14 Mar 2010 17:03:24 +0100
Subject: [PATCH] sha1 checksum for media data analogous to crc
Signed-off-by: Yannick Kechlin <[email protected]>
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
From c20276eddba27e17006385ed8c65974c1764642d Mon Sep 17 00:00:00 2001
From: Yannick Kechlin <[email protected]
Date: Sun, 14 Mar 2010 17:03:24 +0100
Subject: [PATCH] sha1 checksum for media data analogous to crc
Signed-off-by: Yannick Kechlin <[email protected]>
---
libavformat/Makefile | 1 +
libavformat/allformats.c | 1 +
From 9326446b98e2bad9f36ab4bc6286ad89ef21cb67 Mon Sep 17 00:00:00 2001
From: Yannick Kechlin <[email protected]>
Date: Sun, 14 Mar 2010 22:13:11 +0100
Subject: [PATCH] sha nicyfied
---
libavformat/shaenc.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/libavformat/shaenc.c b/libavformat/shaenc.c
require 'datamapper'
class Person
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :managers, 'Person', :through => Resource
require 'datamapper'
class Person
include DataMapper::Resource
property :id, Serial
property :name, String
has n, :managers, 'Person', :through => Resource
has n, :managees, 'Person', :through => :managers, :child_key => [:person_id]