Skip to content

Instantly share code, notes, and snippets.

View hhefesto's full-sized avatar

Daniel Herrera Rendón hhefesto

View GitHub Profile
(defproject com.bm.bmi.date "0.1.0-SNAPSHOT"
:description "Uses antlr date gramar to parse dates"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[clj-antlr "0.2.2"]]
:aot :all
:main com.bm.bmi.date)
{:user {:plugins [[cider/cider-nrepl "0.9.0-SNAPSHOT"]
[refactor-nrepl "0.3.0-SNAPSHOT"]
[lein-pprint "1.1.1"]]
:dependencies [[alembic "0.3.2"]
[slamhound "1.3.1"]]}}
@hhefesto
hhefesto / gist:bdd5c0f780bef841e3a9
Created October 1, 2015 15:24
mi terminal es zsh.
bipolarScaleTask git:(SmartChatInterpreters) ✗ ls
agreementScaleTask.json bipolarScaleTask.json catalog
bipolarScaleTask git:(SmartChatInterpreters) ✗ sed 's/bipolarScaleCatalog/agreementScaleCatalog' <bipolarScaleTask.json > agreementScaleTask.
json
sed: -e expression #1, char 43: unterminated `s' command
@hhefesto
hhefesto / terminal
Created October 5, 2015 21:39
cabal install wai will not work.
➜ cabal install wai
Resolving dependencies...
Configuring wai-3.0.4.0...
Building wai-3.0.4.0...
Failed to install wai-3.0.4.0
Last 10 lines of the build log ( /home/hefesto/.cabal/logs/wai-3.0.4.0.log ):
Network/Wai/HTTP2.hs:189:19:
No instance for (Data.String.IsString Builder)
arising from the literal ‘"File not found."’
➜ aleff ghc-pkg list blaze-builder
/usr/lib64/ghc-7.8.4/package.conf.d
/home/hefesto/.ghc/x86_64-linux-7.8.4/package.conf.d
blaze-builder-0.3.3.4
@hhefesto
hhefesto / from zsh terminal
Last active October 15, 2015 05:19
ghc compilation error
➜ ghc git:(ghc-stable) ✗ make
===--- building phase 0
make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
libraries/bin-package-db/ghc.mk:3: libraries/bin-package-db/dist-boot/package-data.mk: No such file or directory
"/usr/bin/ghc" -H32m -O \
-optc-fno-stack-protector \
\
--make utils/ghc-cabal/Main.hs -o utils/ghc-cabal/dist/build/tmp/ghc-cabal \
-no-user-package-db \
-Wall -fno-warn-unused-imports -fno-warn-warnings-deprecations \
@hhefesto
hhefesto / from zsh terminal
Last active October 15, 2015 05:18
This is what i did to get the compilation error.
sudo dnf install glibc-devel ncurses-devel gmp-devel autoconf automake libtool gcc make perl python ghc happy alex git -y
sudo dnf install docbook-utils docbook-utils-pdf docbook-style-xsl -y
sudo dnf install strace patch -y
git clone --recursive git://git.haskell.org/ghc.git
cd ghc
git checkout ghc-7.10.2-release
git checkout -b ghc-stable
./boot
./configure --prefix=$HOME
@hhefesto
hhefesto / gist:878ec492aa6296001233
Created October 15, 2015 06:07
ghc compile error
➜ ghc git:(ghc-stable) ✗ make
===--- building phase 0
make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds
make[1]: Nothing to be done for 'phase_0_builds'.
===--- building phase 1
make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds
"/usr/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -package-db libraries/bootstrapping.conf -hide-all-packages -i -ighc/. -ighc/st
age1/build -ighc/stage1/build/autogen -Ighc/stage1/build -Ighc/stage1/build/autogen -optP-include -optPghc/stage1/build/autogen/cabal_macro
s.h -package array-0.5.0.0 -package base-4.7.0.2 -package bytestring-0.10.4.0 -package directory-1.2.1.0 -package filepath-1.3.0.2 -package ghc
-7.11 -package process-1.2.0.0 -package unix-2.7.0.1 -Wall -XHaskell2010 -no-user-package-db -rtsopts -odir ghc/stage1/build -hidir ghc/
@hhefesto
hhefesto / Model.hs
Created January 5, 2016 01:25
using yesod's persistent.
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
@hhefesto
hhefesto / internet_example.hs
Created February 3, 2016 19:49
I am working with Persist data constructors, and I would like to be able to derive generic (on the second file) just like it is done on the first file
-----------------------------------------------------------------------------------------------------
-- from http://seanhess.github.io/2015/08/19/practical-haskell-json-api.html
-----------------------------------------------------------------------------------------------------
{-# LANGUAGE DeriveGeneric #-}
module Main where
import Data.Monoid ((<>))
import Data.Aeson (FromJSON, ToJSON)