This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooBarVendor::ItemScanner < Scanner | |
field :title, using_raw: [:title] do |title| | |
title | |
end | |
field :volume, using_raw: [:title] do |title| | |
volume_from_title(title) | |
end | |
field :brand, using_raw: [:category_title] do |category_title| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = React.createClass | |
mixins: [Reflux.ListenerMixin] | |
componentDidMount: -> | |
@listenTo(SessionStore, @onSessionLoaded) | |
SessionStore.request() | |
onSessionLoaded: (user) -> | |
@setState(name: user.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APPNAME = myapp | |
NODENAME = myapp-node | |
HOSTNAME = $(shell hostname) | |
# comma separated | |
COMPILED_MODULES = $(shell ls ebin/*.beam | sed -e 's/\.beam//; s/ebin\///' | paste -sd ',' -) | |
default: compile run | |
refresh: compile _reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls ebin/*.beam | sed -e 's/\.beam//; s/ebin\///' | paste -sd ',' - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erl -sname reloader -noshell -eval " \ | |
lists:foreach(fun (Mod) -> \ | |
rpc:call('$(NODENAME)@$(HOSTNAME)', code, purge, [Mod]), \ | |
{module, Mod} = rpc:call('$(NODENAME)@$(HOSTNAME)', code, load_file, [Mod]), \ | |
ok \ | |
end, [$(COMPILED_MODULES)]), \ | |
init:stop()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case Value1 of | |
Pattern1 -> one(); | |
Pattern2 -> two(); | |
_ -> | |
case Value2 of | |
Pattern3 -> three(); | |
Pattern4 -> four() | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-type dts_dmax() :: { | |
FramesBefore::[frame()], | |
Frame::frame(), | |
Delta::float(), | |
RestFrames::[frame()] | |
}. | |
-spec local_dts_delta_max(Frames::[frame()]) -> {ok, Max::dts_dmax()}. | |
local_dts_delta_max(Frames) -> | |
local_dts_delta_max(Frames, [], undefined, undefined). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13:47:01.738 ------- delta: 32.399999998509884 | |
13:47:01.738 ------- delta: 32.5333333350718 | |
13:47:01.738 ------- delta: 32.55555555596948 | |
13:47:01.739 ------- delta: 32.599999997764826 | |
13:47:01.739 ------- delta: 32.400000002235174 | |
13:47:01.739 ------- delta: 65.3111111111939 | |
13:47:01.739 ------- delta: 32.63333333283663 | |
13:47:01.739 ------- delta: 32.522222220897675 | |
13:47:01.739 ------- delta: 32.58888889104128 | |
13:47:01.739 ------- delta: 32.399999998509884 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-define(REGION_SIZE, 50). | |
-define(TIME_CORRECTION_COEF, 1.0). | |
-define(DELTA_BETWEEN_PACKETS, 5). | |
handle_info(#frame{mpegts = Bin} = Frame, Pusher) when is_binary(Bin) -> | |
case put_to_buffer(Pusher, Frame) of | |
{ok, Pusher1} -> {noreply, Pusher1}; | |
{filled_in, Pusher1} -> | |
{ok, Pusher2} = send_buffer(Pusher1), | |
{noreply, Pusher2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-spec recv(Socket, Length) -> | |
{ok, {Address, Port, Packet}} | {error, Reason} when | |
Socket :: socket(), | |
Length :: non_neg_integer(), | |
Address :: inet:ip_address(), | |
Port :: inet:port_number(), | |
Packet :: string() | binary(), | |
Reason :: not_owner | inet:posix(). | |
recv(S,Len) when is_port(S), is_integer(Len) -> |