Skip to content

Instantly share code, notes, and snippets.

@fponticelli
fponticelli / config.ini
Created June 4, 2012 13:51 — forked from abergie/config.ini
RG Description
cache=2 days
formats=png,html
[params]
start=true
end=true
path=true
@fponticelli
fponticelli / config.ini
Created July 17, 2012 20:13 — forked from abergie/config.ini
RG Description
cache=2 days
formats=png,jpg,pdf,html
screenWidth=580
[params]
start=true
end=true
path=true
token=true
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 / postgresql_color_adt.sql
Created September 19, 2017 02:32 — forked from mlms13/postgresql_color_adt.sql
Create a sum type for colors in 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);
@fponticelli
fponticelli / postgresql_color_adt.sql
Created September 19, 2017 02:32 — forked from mlms13/postgresql_color_adt.sql
Create a sum type for colors in 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 +