Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
function git-sshurl() { | |
local OldUrl=`git remote -v | sed -E -n 's/origin\s*(.*) \(push\)/\1/p'` | |
local NewUrl=`echo $OldUrl | sed -E 's#https://(.*)/(.*)/(.*)#git@\1:\2/\3#'` | |
echo "old url:" $OldUrl | |
echo "new url:" $NewUrl | |
git remote set-url origin $NewUrl | |
} |
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
pong = net_adm:ping(node()). |
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
for i in `seq 1 5`; do erl -sname n${i} -noshell -eval 'io:format("~p~n", [erlang:md5(term_to_binary(lists:foldl(fun(I, Acc) -> Acc#{{abc, I} => I} end, #{}, lists:seq(1,100))))]), init:stop().' ; done | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<208,100,35,243,94,225,254,14,159,222,67,32,242,134,182,171>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
<<22,221,123,219,72,54,94,163,81,131,119,45,111,211,168,96>> | |
What's 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
%?ERROR("ERROR: load_lrn(nil, Opts)~n", [Action, Opts]), |
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
Re: [erlang-questions] gproc and gen_event | |
Of course, for a distributed pub/sub, you don't really need to turn on | |
the distributed parts of gproc. Running a local gproc instance on each | |
node, you can publish like so: | |
publish(Event, Data) -> | |
rpc:eval_everywhere( | |
gproc, send, | |
[{p, l, {?MODULE, Event}}, {?MODULE, Event, Data}]). |
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
$ fc-match "open sans" | |
DejaVuSans.ttf: "DejaVu Sans" "Book" | |
$ mkdir -p ~/.fonts | |
$ cd ~/.fonts | |
# download google fonts downloader, make it executable | |
$ wget https://raw.githubusercontent.com/neverpanic/google-font-download/master/google-font-download | |
$ chmod +x google-font-download |
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(TIME(Call), | |
(fun() -> | |
{Time, Value} = timer:tc(fun() -> Call end), | |
io:format("Call: ~s took: ~p ms~n", [??Call, Time/1000]), | |
Value | |
end)() | |
). | |
In the code: | |
... |
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
sudo update-alternatives --config x-www-browser | |
credits: | |
http://ubuntuforums.org/showthread.php?t=201430 | |
gvfs-mime --query x-scheme-handler/http | |
gvfs-mime --query x-scheme-handler/https | |
gvfs-mime --set x-scheme-handler/http google-chrome.desktop | firefox.desktop | |
gvfs-mime --set x-scheme-handler/https google-chrome.desktop | firefox.desktop |