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
-mod(feature). | |
-export([feature/3]). | |
-spec feature(atom(), fun(), fun()) -> any(). | |
feature(Name, TrueFun, FalseFun)-> | |
case application:get_env(?APPLICATION,toggles, []) of | |
List -> | |
case lists:member(Name,List) of | |
true -> |
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 (boss_tracer). | |
-behaviour (gen_server). | |
-export([start/0]). | |
%% gen_server callbacks | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, | |
terminate/2, code_change/3]). |
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
ça dépend : | |
* le prix qu'il veut mettre | |
* s'il choisi un device indemnisé par son opérateur | |
* de ses préférences personnelles : taille, poids, tronche, feeling global | |
pour moi, éviter à tout prix les constructeurs qui n'upgradent pas l'OS | |
d'une manière générale, le Nexus One et le Nexus S sont bons | |
le HTC Desire (et son successeur HTC Desire S) a un bon succès "mais" possède la surcouche HTC Sense | |
le HTC Desire HD a un gros n'écran : ce sera 4 ou 4.3 la taille d'écran de ma prochaine acquisition (que je reste sur Android ou pas) | |
le HTC Desire Z a un zouli clavier, c'est un appareil classouille | |
les LG Optimus 2X et Samsung Galaxy S ont bonne presse en ce moment... |
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
make_wrq(Method, RawPath, Headers) -> | |
{ok, Dispatch} = file:consult(filename:join( | |
[filename:dirname(code:which(?MODULE)), | |
"..", "priv", "dispatch.conf"])), | |
R0 = wrq:create(Method, {1,1}, RawPath, mochiweb_headers:from_list(Headers)), | |
R1 = wrq:set_peer("127.0.0.1", R0), | |
{_, _, HostTokens, Port, PathTokens, Bindings, AppRoot, StringPath} = | |
webmachine_dispatcher:dispatch("127.0.0.1", RawPath, Dispatch), | |
wrq:load_dispatch_data(Bindings, | |
HostTokens, |
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
This is embedded from github |
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
%% A faire | |
% - passer en configuration l'arborescence des facette (par type) | |
% {mod_search, [{facet, {type, "produit"}, [{"facet.limit",5}], [ | |
% style, | |
% {price, [{query, "price:[*+TO+500]"}, | |
% {query, "price:[500+TO+*]"}]} | |
% ]} | |
% {facet, {type, "session"}, [], [style, gangs]} | |
% ] | |
% } |
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(erldis_multiple). | |
-export([test/0, get_key/1, server/2]). | |
test() -> | |
{ok, Conn} = erldis:connect("localhost", 6379), | |
erldis:zadd(Conn, "erldis_fail", 4.0, "thing1"), | |
erldis:zadd(Conn, "erldis_fail", 4.0, "thing2"), | |
erldis:zadd(Conn, "erldis_fail", 3.5, "thing3"), | |
erldis:zadd(Conn, "erldis_fail", 2.0, "thing4"), | |
erldis:zadd(Conn, "erldis_fail", 6.3, "thing5"), |
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(erldis_multiple). | |
-export([test/0, get_key/1, server/2]). | |
test() -> | |
{ok, Conn} = erldis:connect("localhost", 6379), | |
erldis:zadd(Conn, "erldis_fail", 4.0, "thing1"), | |
erldis:zadd(Conn, "erldis_fail", 4.0, "thing2"), | |
erldis:zadd(Conn, "erldis_fail", 3.5, "thing3"), | |
erldis:zadd(Conn, "erldis_fail", 2.0, "thing4"), | |
erldis:zadd(Conn, "erldis_fail", 6.3, "thing5"), |
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
%#!/usr/bin/env escript | |
%%! -sasl errlog_type info -boot start_sasl -noshell -sname ejabberd | |
% returns on stdout all nodes called NodeName on the EC2 security group. | |
main([NodeName])-> | |
catch ec2nodefinder:start(), | |
Nodes = case catch ec2nodefinder:discover() of | |
{ok, N}-> N; | |
_ -> | |
[] | |
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
%% Analysis results: | |
{ analysis_options, | |
[{callers, false}, | |
{sort, acc}, | |
{totals, true}, | |
{details, false}]}. | |
% CNT ACC OWN | |
[{ totals, 3626, 50.613, 19.008}]. %%% |
NewerOlder