Skip to content

Instantly share code, notes, and snippets.

defmodule Ddd.Macros do
defmacro __using__ do
@rules []
end
defmacro defrule(signature, body) do
quote do
# Prepend the signature to the list of rules....
@rules [ signature | @rules]
[databases]
ckan_default = host=192.168.1.1 port=5432 dbname=ckan_default user=ckan password=PASSWORD
[pgbouncer]
logfile = /var/log/postgresql/pgbouncer.log
pidfile = /var/run/postgresql/pgbouncer.pid
listen_addr = 127.0.0.1
listen_port = 6432
unix_socket_dir = /var/run/postgresql
auth_type = any
@rossjones
rossjones / transfer.py
Last active August 29, 2015 14:10
Transfer dataset from an old CKAN to a single organisation on datahub.io
#!/usr/bin/env python
# mkvirtualenv transfer
# pip install ckanapi
SOURCE = "http://br.ckan.net"
TARGET_ORGANISATION = "open-knowledge-brasil"
SOURCE_TAG = "meta.imported-from-br-ckan-net"
import ckanapi
Interactive Elixir (1.0.2) - press Ctrl+C to exit (type h() ENTER for help)
v(1): [1,2,3]
[1, 2, 3]
v(2): [45, 46, 47]
'-./'
pipeline :browser do
plug :accepts, ~w(html)
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
end
pipeline :api do
plug :accepts, ~w(json)
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_total_relation_size(C.oid)) AS "total_size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND C.relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY pg_total_relation_size(C.oid) DESC
LIMIT 20;
v(1): <<"@" :: utf8, v :: binary>> = "@admin_email"
"@admin_email"
v(2): <<"@" :: utf8, v :: utf8>> = "@admin_email"
** (MatchError) no match of right hand side value: "@admin_email"
---- Minecraft Crash Report ----
// Why is it breaking
Time: 2/8/15 4:12 PM
Description: Initializing game
java.lang.ExceptionInInitializerError
at mod_PizzaMod.<init>(mod_PizzaMod.java:120)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[error] Error in process <0.402.0> with exit value: {#{'__exception__'=>true,'__struct__'=>'Elixir.Protocol.UndefinedError',description=>nil,protocol=>'Elixir.String.Chars',value=>{invalid,<<1 byte>>}},[{'Elixir.String.Chars','impl_for!',1,[{file,"lib/string/chars.ex"},{line,3}]},{'Elixir.String.Chars'...
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in Phoenix.Transports.WebSocket.ws_info/2
(phoenix) lib/phoenix/transports/websocket.ex:67: Phoenix.Transports.WebSocket.ws_info(%{"behaviour" => "behaviours/global/my.behaviour", "post" => %{"demographics" => [%{"hospital_number" => "54321", "nhs_number" => "1234"}], "diagnosis" => %{"condition" => "CAP"}}, "pre" => %{"demographics" => [%{"hospital_number" => "54321", "nhs_number" => "1234"}], "diagnosis" => %{"condition" => "CAP"}}, "success" => true}, %{router: Cedar.Router, serializer: Phoenix.Transports.JSONSerializer, sockets: #HashDict<[{"audit:all", %Phoenix.Socket{assigns: %{}, authorized: true, channel: Cedar.AuditChannel, pid: #PID<0.419.0>, router: Cedar.Router, topic: "audit:all", transport: Phoenix.Transports.WebSocket}}]>})
(phoenix) lib/phoenix/endpoint/cowboy_websocket.ex:62: Phoenix.Endpoint.CowboyWebSocket.websocket_info/3
(cowboy) src/cowboy_websocket.erl:588: :cowboy_websock