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
@mlms13
mlms13 / postgresql_color_adt.sql
Last active Sep 19, 2017
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);
@Ravenstine
Ravenstine / aws-couchdb-setup.md
Last active Aug 27, 2019
Fast CouchDB setup in AWS
View aws-couchdb-setup.md

Fast CouchDB setup in AWS

CouchDB is a NoSQL database for storing JSON documents. It comes with a REST API out of the box so your client applications can persist data while requiring you to write little or no server-side code. CouchDB's killer feature is its ability to easily replicate, which allows for horizontal scaling, easy backup, and for client adapters to synchronize documents. This is perfect if you want to write an application that is offline-first. It's become my go-to database when creating new

@nadako
nadako / Main.hx
Created Jun 24, 2015
Haxe + SDL = native love \o/
View Main.hx
class Main {
static function main() {
Sdl.init(Sdl.INIT_EVERYTHING);
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL);
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED);
var bmp = Sdl.loadBMP("test.bmp");
var tex = Sdl.createTextureFromSurface(ren, bmp);
Sdl.freeSurface(bmp);
for (i in 0...3) {
View stream.js
import Timer from 'ui/timer';
let _listeners = Symbol();
class Source {
constructor(callback) {
this[_listeners] = [];
let sink = (value) => {
Timer.immediate(() => {
this[_listeners].map=> ƒ(value));
@dpeek
dpeek / gist:7803958
Created Dec 5, 2013
Building Haxe for Android
View gist:7803958
$ mkdir haxe-droid && cd haxe-droid
$ git clone https://github.com/vouillon/ocaml-android.git
$ git clone https://github.com/HaxeFoundation/haxe.git
$ http://dl.google.com/android/ndk/android-ndk-r9b-darwin-x86.tar.bz2
$ tar -vjxf android-ndk-r9b-darwin-x86.tar.bz2 && rm android-ndk-r9b-darwin-x86.tar.bz2 && mv android-ndk-r9b android-ndk
$ wget http://caml.inria.fr/pub/distrib/ocaml-4.01/ocaml-4.01.0.tar.gz
$ tar -xzf ocaml-4.01.0.tar.gz && rm ocaml-4.01.0.tar.gz && mv ocaml-4.01.0 ocaml-src
@deltaluca
deltaluca / gist:5413225
Created Apr 18, 2013
16.16 Fixed point numbers in Haxe 3
View gist:5413225
abstract Fixed16(Int) {
inline function new(x:Int) this = x;
inline function raw() return this;
inline static function RAW(x:Int) return new Fixed16(x);
public static var MAX_VALUE:Fixed16 = RAW(0x7fffffff);
public static var MIN_VALUE:Fixed16 = RAW(1);
@:from public static inline function fromf(x:Float) {
#if debug
@puffnfresh
puffnfresh / Catamorphism.hx
Created Apr 16, 2013
Automatically deriving a catamorphism from a closed interface.
View Catamorphism.hx
package precog.macro;
import haxe.macro.Expr;
import haxe.macro.Context;
class Catamorphism {
#if macro
public static function build(classes: Array<String>) {
var fields = Context.getBuildFields();
fields.push(cataMethod(classes, null));
@puffnfresh
puffnfresh / Example.hx
Last active May 13, 2018
Macro to generate "value classes" in Haxe
View Example.hx
import precog.macro.ValueClass;
class ABC implements ValueClass {
var a: Int;
var b: Bool;
var c: String;
}
/*
class ABC extends ValueClass {
@tong
tong / NekoBoot.hx
Last active Dec 14, 2015
Haxe port of nekoboot.neko for creating executables from bytecode. Original: http://code.google.com/p/nekovm/source/browse/trunk/src/tools/nekoboot.neko Usage : nekoboot <file.n>
View NekoBoot.hx
import sys.FileSystem;
import sys.io.File;
/**
Haxe port of nekoboot.neko for creating executables from neko bytecode.
Original version: https://github.com/HaxeFoundation/neko/blob/master/src/tools/nekoboot.neko
Usage : nekoboot <file.n>
*/
View sass_and_less_compared.markdown

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

You can’t perform that action at this time.