Skip to content

Instantly share code, notes, and snippets.

defmodule DarkKernel.DarkMutable do
alias DarkKernel.Debugger
def __set__(ref, value) do
Process.put(ref, value)
end
def __get__(ref) do
Process.get(ref)
end
// Local files can be imported directly using relative paths, for example:
import socket from "./socket"
import PhoenixWS from "./phoenix_ws"
function initializeChat() {
// Build a new PhoenixWS from the phoenix socket
const connection = new PhoenixWS(socket, "room:lobby", {});
connection.onopen = () => {
console.log('connected');
@tmbb
tmbb / xaredb-websocket.js
Created November 24, 2019 19:13
Websocket over phoenix channels
/**
* This function generates an event that is compatible with standard
* compliant browsers and IE9 - IE11
*
* This will prevent the error:
* Object doesn't support this action
*
* http://stackoverflow.com/questions/19345392/why-arent-my-parameters-getting-passed-through-to-a-dispatched-event/19345563#19345563
* @param s String The name that the event should use
* @param args Object an optional object that the event will use
@tmbb
tmbb / release.exs
Created December 2, 2018 15:10
A script to automatie releases of elixir packages.
defmodule Releaser.VersionUtils do
@doc """
Some utilities to get and set version numbers in the `mix.exs` file
and to programatically transform version numbers.
Maybe the `bump_*` functions should be in the standard library?
This script doesn't support pre-release versions or versions with build information.
"""
@version_line_regex ~r/(\n\s*@version\s+")([^\n]+)("\n)/