- Update pg_hba.conf (most likely in /etc/postgresql/9.4/main) with -
host all all 0.0.0.0/0 trust
- Update postgresql.conf to use
listen_addresses = '*' - Be sure to
sudo service postgresql restart
Configure Vagrant
| {- | |
| To use this module, import it in Foundation and make your App an instance of JSRoutable - | |
| instance JSRoutable App where | |
| jsRoutes = jsRoutesBuilder resourcesApp | |
| You will want to add the following line to your routes file - | |
| /jsRoutes JSRoutesR GET |
| import Control.Monad.Reader | |
| import System.IO | |
| import System.Process | |
| data NodeJS = NodeJS | |
| { nodeIn :: Handle | |
| , nodeOut :: Handle | |
| , nodeErr :: Handle | |
| , nodePid :: ProcessHandle | |
| } |
| -- Most of these pragmas probably aren't needed, just ripped from Yesod.Form.Functions | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TupleSections #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE CPP #-} | |
| import ClassyPrelude.Yesod | |
| import Control.Monad.Trans.RWS (evalRWST) |
| {-# LANGUAGE QuasiQuotes #-} | |
| module BadQQCPP where | |
| import Language.Haskell.TH | |
| import Language.Haskell.TH.Syntax | |
| import Language.Haskell.TH.Quote | |
| quoter :: QuasiQuoter | |
| quoter = QuasiQuoter { quoteExp = lift } |
| sudo apt-get update | |
| sudo apt-get purge postgresql-9.1 postgresql-9.2 postgresql-9.3 | |
| # If you don't need postgis, you can probably get away with postgresql-contrib instead. | |
| sudo apt-get install postgresql-client-common postgresql-9.4 postgresql-9.4-postgis-2.1 |
| #!/bin/bash | |
| set -ex | |
| # Sets the port that IntelliJ attaches to | |
| true ${LISTEN_PORT:=5005} | |
| # Sets whether or not the process waits for the debugger to attach | |
| true ${SUSPEND:=y} | |
| JVM_DEBUG=-Xdebug |
| object Main { | |
| def main(args: Array[String]) = { | |
| implicit val pg = PostgreSQLConnection(ConnectionImpl("pg")) | |
| implicit val mysql = MySQLConnection(ConnectionImpl("mysql")) | |
| println(queryPostgreSQL("foo")) // prints "selected foo from pg" | |
| println(queryMySQL("bar")) // prints "selected bar from mysql" | |
| } | |
| def queryPostgreSQL(x: String)(implicit pg: PostgreSQLConnection): String = pg { implicit c => | |
| doQuery(x) |
I hereby claim:
To claim this, I am signing this object: