Skip to content

Instantly share code, notes, and snippets.

Matt Weldon mattweldon

View GitHub Profile
mattweldon / environment.js
Created May 18, 2016
Ember ContentSecurityPolicy
View environment.js
contentSecurityPolicy: {
'default-src': "'none'",
'script-src': "'self'",
'connect-src': "'self'",
'style-src': "'self' 'unsafe-inline'",
'font-src': "'self' 'unsafe-inline'",
'img-src': "'self'"
// Goes between EmberENV and APP in /config/environment.js
mattweldon / pubsub.ex
Created Feb 21, 2016
Simple PubSub implementation using Redix (Exredis)
View pubsub.ex
defmodule PubSub do
def broadcast(channel, topic, payload) do
{:ok, client} = Exredis.start_link
payload = payload |> Map.put(:topic, topic)
client |> Exredis.Api.publish channel, Poison.encode!(payload)
def subscribe(channel, module) do
sup = spawn_link fn -> accept_messages(module) end
mattweldon /
Last active Jun 23, 2018
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new droplet
  • London
  • Ubuntu
  • No apps
  • Add SSH keys
mattweldon / post-route.js
Last active Aug 29, 2015
Ember Nested URLs Error
View post-route.js
// ...
model: function(params) {
// ...
var versions ='post-version', post.get('id'));
// http://localhost:4101/api/v1/posts/1/versions gets called correctly...
View adapters-post-version.js
import DS from "ember-data";
export default DS.RESTAdapter.extend({
host: 'http://localhost:4101/api/v1',
buildURL: function(root, suffix, record) {
var url = this._super();
return url + '/posts/' + suffix + '/versions';
You can’t perform that action at this time.