Skip to content

Instantly share code, notes, and snippets.

Franco Ponticelli fponticelli

Block or report user

Report or block fponticelli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fponticelli
fponticelli / postgresql_color_adt.sql
Created Sep 19, 2017 — forked from mlms13/postgresql_color_adt.sql
Create a sum type for colors in sql
View postgresql_color_adt.sql
create type custom_color as (r smallint, g smallint, b smallint);
create type named_color as enum ('red', 'green', 'blue');
create type color as (named named_color, custom custom_color);
create or replace function check_color(c color) returns boolean as $$
begin
return
(c.named IS NOT NULL)::int +
@fponticelli
fponticelli / postgresql_color_adt.sql
Created Sep 19, 2017 — forked from mlms13/postgresql_color_adt.sql
Create a sum type for colors in sql
View postgresql_color_adt.sql
-- data NamedColor = Red | Green | Blue
-- data CustomColor = CustomColor
-- { r :: Int
-- , g :: Int
-- , b :: Int
-- }
-- data Color = NamedColor | CustomColor
create type custom_color as (r int, g int, b int);
View Haxe reflection based script thing.
private typedef _SActionFunc = EntityScript -> _SA -> Void;
private class _SActions {
// Every function in this class must be of type _SActionFunc.
// Who knows what will happen if this is not true.
public static function Idle(entity:EntityScript, action:_SA):Void {
}
public static function AnotherAction(entity:EntityScript, action:_SA):Void {
}
@fponticelli
fponticelli / config.ini
Created Jul 17, 2012 — forked from abergie/config.ini
RG Description
View config.ini
cache=2 days
formats=png,jpg,pdf,html
screenWidth=580
[params]
start=true
end=true
path=true
token=true
@fponticelli
fponticelli / config.ini
Created Jun 4, 2012 — forked from abergie/config.ini
RG Description
View config.ini
cache=2 days
formats=png,html
[params]
start=true
end=true
path=true
You can’t perform that action at this time.