Tuesday, July 22, 2014

[PostgreSQL] See SQL queries (without restarting the server!)


1. In postgresql.conf (probably under /etc/postgres/...), uncomment log_statement and set to 'all'
log_statement = 'all'
2. To reload config, sending SIGHUP to postgres server by going to psql shell and execute:
select pg_reload_conf();
    There's an another way to send SIGHUP, please refer to the link below

3. Observe the queries at postgresql.log (probably under /var/log/...)
4. To disable, comment out log_statement and reload config again

log_statementreloading postgresql config

Credit: http://stackoverflow.com/a/8208376

Sunday, July 20, 2014

Run clojure.test inside Light Table

Simply add a line
(run-tests)
and evaluate source code normally (cmd+shift+enter). See the output in the console.

Clojure has lesser typing error problems than the others well-known dynamic typing languages

Give these snippets a try. // JS function foo () {   bar(1) } # Ruby def foo   bar(1) end ; Clojure (defn foo []    (bar 1)) As yo...