Skip to content

Instantly share code, notes, and snippets.

View erikkaplun's full-sized avatar

Erik Kaplun erikkaplun

  • UXO
  • Tallinn, Estonia
View GitHub Profile
package httpserverhelloworld;
import java.io.*;
import java.net.InetSocketAddress;
import com.google.gson.Gson;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
@erikkaplun
erikkaplun / main.hs
Created October 10, 2018 09:04
PrizeMiniRouter created by eallik - https://repl.it/@eallik/PrizeMiniRouter
import Data.Time.Clock.POSIX (getPOSIXTime)
timeNanos, timeMicros, timeMillis :: IO Integer
t x = round . (x * ) <$> getPOSIXTime
timeNanos = t 1000000000
timeMicros = t 1000000
timeMillis = t 1000
main :: IO ()
# For more information, see: https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md
# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: ghc-7.10.3
# Local packages, usually specified by relative directory name
packages:
- '.'
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
Last login: Wed Dec 23 13:28:48 on ttys008
~$ brew untap mcuadros/hhvm
Error: No available tap mcuadros/hhvm.
~$ brew update; brew upgrade
Updated Homebrew from bce89851 to 2af05100.
Updated 2 taps (caskroom/cask, homebrew/science).
==> New Formulae
artifactory-cli-go digitemp gowsdl ploticus
clog elm homebrew/science/ess scour
==> Updated Formulae
~$ brew cleanup hhvm
~$ brew install --verbose hhvm
==> Installing hhvm from hhvm/hhvm
==> Downloading http://dl.hhvm.com/source/hhvm-3.11.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/hhvm-3.11.0.tar.bz2
==> Verifying hhvm-3.11.0.tar.bz2 checksum
tar xf /Library/Caches/Homebrew/hhvm-3.11.0.tar.bz2
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/hhvm/3.11.0 -DDEFAULT_CONFIG_DIR=/usr/local/etc/hhvm -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_ASM_COMPILER=/usr/local/opt/llvm/bin/clang -DENABLE_MCROUTER=OFF -DENABLE_EXTENSION_MCROUTER=OFF -DENABLE_EXTENSION_IMAP=OFF -DMYSQL_UNIX_SOCK_ADDR=/tmp/mysql.sock -DCMAKE_C_FLAGS=-I/usr/local/opt/readline/include -L/usr/local/opt/readline/lib -DCMAKE_CXX_FLAGS=-I/usr/local/opt/readline/include -L/usr/local/opt/readline/lib -DBOOST_INCLUDEDIR=/usr/local/opt/boost/include -DBOOST_LIBRARYDIR=/usr/local/opt/boost/lib -DFREETYPE_INCLUDE_DIRS=/usr/local/opt/freetype/include/freetype2 -DFREETYPE_LIBRAR
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UnicodeSyntax #-}
module Entrypoint
( runMain
2015-12-20 01:35:25 +0200
cmake
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/hhvm/3.11.0
-DDEFAULT_CONFIG_DIR=/usr/local/etc/hhvm
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang
-DCMAKE_ASM_COMPILER=/usr/local/opt/llvm/bin/clang
-DENABLE_MCROUTER=OFF
-DENABLE_EXTENSION_MCROUTER=OFF
{"title":"Niger","version":"1.0.3","type":"FeatureCollection","copyright":"Copyright (c) 2014 Highsoft AS, Based on data from Natural Earth http://www.naturalearthdata.com","copyrightShort":"Natural Earth","copyrightUrl":"http://www.naturalearthdata.com","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG:26392"}},"features":[{"type":"Feature","id":"NE.NI","properties":{"hc-group":"admin1","hc-middle-x":0.48,"hc-middle-y":0.44,"hc-key":"ne-ni","hc-a2":"NI","labelrank":"6","hasc":"NE.NI ","alt-name":null,"woe-id":"20069994","subregion":null,"fips":"NG09","postal-code":"NI","name":"Niamey","country":"Niger","type-en":"Capital District","region":null,"longitude":"2.12167","woe-name":"Niamey","latitude":"13.562","woe-label":"Niamey, NE, Niger","type":"Communauté Urbaine"},"geometry":{"type":"Polygon","coordinates":[[[214,717],[230,716],[237,710],[231,690],[214,693],[202,706],[205,716],[214,717]]]}},{"type":"Feature","id":"NE.TH","properties":{"hc-group":"admin1","hc-middle-x":0.50,"hc-middle-y":0.61,
~/code/idris/idris-tutorial$ pandoc --from=latex --to=epub idris-tutorial.screen.tex -o idris-tutorial.screen.epub
pandoc:
Error at "./content/typesfuns.tex" (line 688, column 9):
unexpected " "
expecting "{" or "\\"
(that is, \Idris{} uses \emph{eager} evaluation). However, this is not always
^
import scala.util.Try
import scalaz._, Scalaz._
object InputValidation {
type Va[A] = Validation[String, A]
type VaNel[A] = ValidationNel[String, A]
type Vali[A, B] = Kleisli[Va, A, B]
type ValiNel[A, B] = Kleisli[VaNel, A, B]