Our ideal code is short, easy to read, has good tests and no compile warnings. New code should be written to conform to those standards, but existing code may not already meet that standard. In that case we should aim to improve that code over time.
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(rebar_yang). | |
-compile(export_all). | |
%% Add to rebar.config | |
%% {plugins, [rebar_yang]}. | |
pre_compile(_Config,AppFile) -> | |
rebar_log:log(info, "rebar_yang: ~p~n", [rebar_utils:get_cwd()]), | |
scan_files(rebar_utils:get_cwd()), | |
ok. |
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
//-*- Javascript -*- | |
'use strict'; | |
angular.module('xray') | |
.service('xray:tposs:test', function MockCdrList() { | |
var fields = [ | |
{ | |
"fieldName": "LocationId", | |
"type": "string", | |
"description": "Location object identifier.", |
Some Notes on building packages
A developer must be able to make a build in one step. Ideally he should be able to type build <> <> and have a build happen with no further intervention. By making the developer only type one command we greatly reduce the chance that a step will be forgotten, done out order or otherwise messed up.
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
language: erlang | |
notifications: | |
disabled: true | |
install: | |
- wget http://www.quviq.com/downloads/eqcmini.zip | |
- unzip eqcmini.zip | |
- export ERL_LIBS=eqcmini | |
script: |
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
connected(A,B) :- | |
edge(A,B). | |
sib(A,B) :- | |
path(C,A,_), | |
path(C,B,_), | |
\+path(A,B,_), | |
\+path(B,A,_). | |
ancestor(A,B) :- |
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
prop_render() -> | |
{ok, online_users_dtl} = erlydtl:compile_file("templates/online_users.dtl", online_users_dtl, []), | |
?FORALL(Rs, | |
list(presence()), | |
begin | |
{ok,HTML} = vest_current_users:render(Rs), | |
mochiweb_html:parse(iolist_to_binary(HTML)), %% assert that it is valid HTML | |
[_Prefix,Rows,_Suffix] = HTML, | |
length(Rows) =:= length(Rs) | |
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
-module(erl_cache_tests). | |
-include_lib("proper/include/proper.hrl"). | |
-include_lib("eunit/include/eunit.hrl"). | |
-compile(export_all). | |
keys() -> | |
[ | |
"AAAAAAAA", | |
"8BFE5E9B", | |
"59665E9E", |
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
%-*- Prolog -*- | |
split(Head, Tail, HeadLength, FullList) :- | |
length(Head, HeadLength), | |
append(Head, Tail, FullList). | |
?- split(H,T, 3, [a,b,c,d,e,f,g,h,i,j,k,l]). | |
H = [a, b, c], | |
T = [d, e, f, g, h, i, j, k, l]. |
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(json_test). | |
-include_lib("eqc/include/eqc.hrl"). | |
-include_lib("eunit/include/eunit.hrl"). | |
-compile(export_all). | |
-include("erlog_test.hrl"). | |
json_test() -> | |
{ok, ERLOG_STATE} = erlog:new(), | |
Data = [{<<"test">>, 12345}], | |
?assertMatch({{succeed,_},_}, erlog:prove(ERLOG_STATE, {length, Data, {'Len'}})). |
OlderNewer