Skip to content

Instantly share code, notes, and snippets.

View netogallo's full-sized avatar

Ernesto Rodriguez netogallo

  • Technical University of Munich
View GitHub Profile
MX Server address Priority
ASPMX.L.GOOGLE.COM. 1
ALT1.ASPMX.L.GOOGLE.COM. 5
ALT2.ASPMX.L.GOOGLE.COM. 5
ASPMX2.GOOGLEMAIL.COM. 10
ASPMX3.GOOGLEMAIL.COM. 10
@netogallo
netogallo / Esta bien?
Last active August 29, 2015 14:21
Tasks
{
"author":{"username":"neto"},
"name":"Our big duty",
"participants":[{"username":"neto"},{"username":"kmels"}],
"tasks":[
{
"name":"My free task",
"penalty":0.000155,
"expiry_epoch":1432041949423,
"state":"Free",
Task = {type: "object", properties: {name: {type: "string"}}}
Duty = {type: "object", properties: {task: {$ref: "Task"}}}
es equivalente a:
Duty = {type: "object" ,properties: {task: {type: "object", properties: {name: {type: "string"}}}}}
Osea $ref es como hacer abstracion y nombrar la variable "Task" y es referentially transparent.
@netogallo
netogallo / kill.hs
Created March 23, 2015 16:29
killer
import Control.Concurrent.MVar
import System.IO.Unsafe
ref = unsafePerformIO $ newEmptyMVar
data T = T Int Int Int deriving Show
main = do
putMVar ref ()
x <- (takeMVar ref :: IO T)
@netogallo
netogallo / sample create
Last active August 29, 2015 14:14
Example to extend SQLProvider with PSQL transactions
let pkCache = Collections.Generic.Dictionary<string,Column>()
type FSharp.Data.Sql.Runtime.SqlDataContext with
member o.SayHi with get() = "Hi"
member this.PKLookup(provider : ISqlProvider, table : Table, con' : Data.IDbConnection option) =
if pkCache.ContainsKey table.FullName then pkCache.[table.FullName]
else
let con = match con' with
| Some c when c.State = Data.ConnectionState.Open -> c
| Some c-> c.Open();c
let cols = provider.GetColumns(con,table)
import Control.Monad (forever)
instance Num (IO a) where
fromInteger i = print i >> return undefined
main = forever 21
@netogallo
netogallo / Haskell
Last active August 29, 2015 13:57
Exp Complexity
data ExpTree t = ExpTree t (ExpTree t) (ExpTree t)
-- '.' denotes function composition in Haskell ie:
-- (f . g) x == f (g x)
f1 = ExpTree . ExpTree . ExpTree
f2 = f1 . f1 . f1 . f1
f3 = f2 . f2 . f2
@netogallo
netogallo / gist:9259409
Created February 27, 2014 20:58
Agda loop
data _==_ {a} {A : Set a} (x : A) : A → Set a where
Refl : x == x
data SubList {a : Set} : List a -> List a -> Set where
Base : SubList Nil Nil
Keep : forall {x xs ys} -> SubList xs ys -> SubList (Cons x xs) (Cons x ys)
Drop : forall {y zs ys} -> SubList zs ys -> SubList zs (Cons y ys)
@netogallo
netogallo / SearchWithSuggestions.fs
Last active December 21, 2015 00:19
Simple example showing how to create a input box that provides suggestions using Piglets.
module SearchWithSuggestions
open IntelliFactory.WebSharper
open IntelliFactory.WebSharper.Html
open SenchaTouch
open IntelliFactory.WebSharper.Piglets
[<JavaScript>]
module View =
@netogallo
netogallo / app.js
Created August 9, 2013 19:19
Kaiser Buenote
//Vos copia esto
var express = require('express')
, http = require('http')
, path = require('path');
//Creas una web app
var app = express();
//localhost:2000/test?arg=5&numero=hola
var getTest = function(req,res){