Skip to content

Instantly share code, notes, and snippets.

View brightball's full-sized avatar

Barry Jones brightball

View GitHub Profile
@brightball
brightball / erlang_buildpack.sh
Last active June 7, 2021 14:27
Erlang Buildpack
#!/bin/bash
# Install a custom Erlang version, https://www.erlang.org/
#
# Add at least the following environment variables to your project configuration
# (otherwise the defaults below will be used).
# * ERLANG_VERSION
#
# Uses https://github.com/elixir-buildpack/heroku-otp/releases
#
# Include in your builds via
@brightball
brightball / ecto_postgres_fulltext_search_querying_example.ex
Created October 6, 2017 14:02 — forked from pmarreck/ecto_postgres_fulltext_search_querying_example.ex
How to set up postgres fulltext search triggers, index, and tsvector column on Elixir/Phoenix, with Ecto querying, including ranking and sorting by rank
defmodule YourAppName.Search do
# ...
@doc """
Queries listings.
"""
def query_listings(query, current_user) do
default_scope = from l in Listing, where: l.draft == false or l.user_id == ^current_user.id, order_by: [desc: l.updated_at], limit: 50
id = _try_integer(query)
@brightball
brightball / gist:3208176
Created July 30, 2012 16:22 — forked from sb4m/gist:3193448
Clean Install – Mountain Lion OS X 10.8 DP3