Skip to content

Instantly share code, notes, and snippets.

@telnicky
telnicky / docker-compose.yml
Created September 11, 2016 00:23
Docker compose file for Phoenix and Convox
web:
build: .
ports:
- 80:4040
- 443:4040
command: mix phoenix.server
labels:
- convox.port.80.protocol=http
- convox.port.443.protocol=https
@telnicky
telnicky / DockerFile
Last active September 10, 2016 20:40
Dockerfile for a Phoenix application
FROM elixir:1.3
RUN apt-get update
RUN apt-get install -y erlang-dev erlang-parsetools
ENV PHOENIX_VERSION 1.2.0
RUN mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phoenix_new-$PHOENIX_VERSION.ez
WORKDIR /code
COPY . .
@telnicky
telnicky / raw_query.exs
Created September 9, 2016 04:30
Raw sql query in ecto
query = """
SELECT id, name, inserted_at
FROM users
UNION
SELECT id, name, inserted_at
FROM customers
WHERE name = $1
"""
Ecto.Adapters.SQL.query!(MyApp.Repo, query, ["Carol"])
@telnicky
telnicky / JankyBot.rb
Last active August 29, 2015 14:11
my janky robot
require 'rrobots'
class JankyBot
include Robot
def tick(event)
accelerate(rand(8))
turn(rand(10))
fire(rand(3))
end