Skip to content

Instantly share code, notes, and snippets.

View albertoarena's full-sized avatar

Alberto Arena albertoarena

View GitHub Profile
@albertoarena
albertoarena / README.md
Last active September 9, 2026 07:04
Real Laravel schemas exported to DBML by Truss, for testing a DBML importer. Structure only, never data.

Truss DBML exports, for testing an importer

Five DBML files written by Truss, a Laravel package that draws an ER diagram (ERD) from a live database. Four come from real open source Laravel applications, one is synthetic and exists only to carry the awkward shapes.

They are here so an importer can be tested against real output instead of hand-written samples. Nothing here is a benchmark and nothing scores the applications: this is structure only, no rows, no data.

@albertoarena
albertoarena / person.js
Last active August 29, 2015 14:14
Sample Person object using the getter/setter, as a RequireJS module
define(['getterSetter', function(getterSetter) {
return function(options) {
if (typeof options != 'object') {
options = {};
}
// We assume you can't change your name!
this.name = options.name;
// Role, e.g. Web developer
@albertoarena
albertoarena / getterSetter.js
Last active August 29, 2015 14:14
Getter/Setter RequireJS module
define([], function () {
return function(initValue, callback) {
var val = initValue;
if (typeof callback != 'function') {
callback = null;
}
return function (v) {
if (v !== undefined) {
val = v;
@albertoarena
albertoarena / FileStorageFactory.php
Last active November 11, 2020 12:37
Using the Factory method pattern to have different file storage mechanisms.
<?php
/**
* Class FileStorageFactory
* A factory class that instantiates the appropriate FileStorage engine
*/
class MyProject_Service_FileStorageFactory
{
/**
* Available file storage mechanisms