Skip to content

Instantly share code, notes, and snippets.

View jneira's full-sized avatar
:octocat:

Javier Neira jneira

:octocat:
View GitHub Profile
@jneira
jneira / Main.hs
Last active December 1, 2017 07:42
{-# LANGUAGE BangPatterns #-}
module Main where
import System.Random (randomRIO)
import Data.Monoid (Sum(..),(<>))
import Data.Tree
main :: IO ()
main = main'
class UIState {
def context
// From params
Boolean filtrar=false
Boolean disabled=false
Boolean withNew=true
Boolean withDelete=true
Boolean embedded=false
Boolean returnEmbedded=false
@jneira
jneira / PureIO.cs
Created September 7, 2017 21:40 — forked from tonymorris/PureIO.cs
A demonstration of pure-functional I/O using the free monad in C#
using System;
namespace PureIO {
/*
C# does not have proper sum types. They must be emulated.
This data type is one of 4 possible values:
- WriteOut, being a pair of a string and A
- WriteErr, being a pair of a string and A
- readLine, being a function from string to A
import java.util.List;
import java.util.stream.Stream;
import static java.util.stream.Collectors.*;
public class Prueba {
public static void main(String[] args) {
Integer i=getInt(new Integer(2));
int j=getInteger(3);
System.out.println(idsToStringList(new Person(i),new Person(j)));
@jneira
jneira / eta.en.md
Last active May 7, 2017 20:39
eta-lang rationale
  1. What do you like about eta and why?    Basically I approach eta because it joins one of my favorite languages    with one of the platforms that I usually work with and I'm more comfortable, the jvm.    I especially like that it starts out from the nuclear ecosystem of haskell: ghc, cabal, hackage ...
  2. Why would you choose eta rather than java, clojure or scala?     I am convinced that pure functional programming can be a decisive breakthrough for     many types of software devlopment. The support for it is very limited in java and is not enough complete     in clojure or scala to be really effective in my opinion.
  3. If Eta could be used in production, the tools were ripe and there were good materials     To learn, would you try to adopt it in your company (or recommend it to your friends). If so,
@jneira
jneira / MultipartFileSender.java
Last active March 10, 2023 17:49 — forked from davinkevin/MultipartFileSender
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.codehaus.groovy.grails.commons.GrailsClassUtils
import org.codehaus.groovy.grails.commons.GrailsDomainClass
import org.codehaus.groovy.grails.commons.GrailsDomainClassProperty
import org.codehaus.groovy.grails.orm.hibernate.cfg.DefaultGrailsDomainConfiguration
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration;
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder
import org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
import org.codehaus.groovy.grails.orm.hibernate.cfg.Mapping
import org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware
import org.hibernate.MappingException;
@jneira
jneira / Enum.ts
Last active January 18, 2017 21:10
// simular las typeclasses Enum y Bounded de haskell
interface Bounded<T> {
minBound: T
maxBound: T
}
interface Enum<T> {
fromEnum(number): T
toEnum(T): number
}
module All where
import Life
import Grass
import Sheep
import Wolf
main = do
putStrLn "Grass:"
print $ eat Grass [Grass]
print $ eat Grass [Sheep]
@prefix : <http://base/#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
:service1 a fuseki:Service ;
fuseki:dataset <#dataset> ;
fuseki:name "Quijote" ;