Skip to content

Instantly share code, notes, and snippets.

@singularitypostman
singularitypostman / stream.erl
Created April 6, 2022 19:26 — forked from zkessin/stream.erl
Erlang Data Streaming
-module(streaming).
-export([stream_data/1, out/1, stream_from_file/3]).
out(_Arg) ->
_Pid = spawn_link(?MODULE, stream_data, [self()]),
{streamcontent, "audio/mp3", <<>>}.
stream_data(Pid) ->
File = "/home/erlang/erlang-talk/audio.mp3",
FileHDL = open_file(File),
stream_from_file(Pid, FileHDL, 1).
@singularitypostman
singularitypostman / date_util.erl
Created March 20, 2022 22:13 — forked from zaphar/date_util.erl
set of utility functions that wrap the calendar module and erlangs now() date() and time() functions
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.