Skip to content

Instantly share code, notes, and snippets.

(defun esk-pretty-fun ()
(font-lock-add-keywords
nil `(("\\(\\<fun\\>\\)("
(0 (progn (compose-region (match-beginning 1)
(match-end 1)
"\u0192" ;; ,(make-char 'greek-iso8859-7 107) for lambda
'decompose-region)))))))
(add-hook 'erlang-mode-hook 'esk-pretty-fun)
(setq correct-paren-alist
'(( "[" . "]" )
( "(" . ")" )
( "{" . "}" )
( "<<" . ">>" )))
(defun insert-correct-paren ()
(interactive)
(let* ((closed-parens 0)
(correct-paren ")" )
ability - 6 (4+2)
inventory - 6 (6 items)
select - 4 (hero all other courier)
player - 2 (attack stop move? hold?)
courier - 2 (deliver burst)
learn - 2 (learn stats)
shop - 2 (shop quickbuy)
chat - 2 (voice wheel)
ets:select(Tab, [{{'$1', '_', '_', '_'},[],['$1']}], 10).
{[{1383242643,746081},
{1383293043,948240},
{1383292743,966571},
{1383287643,925604},
{1383261243,820525},
{1383260043,828302},
{1383243543,748386},
{1383240243,743004},
{1383234543,716093},
0 1 2 3 4 5 6 7 8 9 A B C D E F
0040 __ __ __ __ 4b 00 00 00 7d 01 00 42 00 00 00 00
0050 00 00 00 80 00 00 00 01 15 32 d1 53 83 77 47 52
0060 80 00 01 ff 52 a4 5b aa 52 a4 5b aa 00 00 00 00
0070 00 00 00 00 01 00 2f 06 00 6e 6f 62 6f 64 79 06
0080 00 6e 6f 62 6f 64 79 06 00 6e 6f 62 6f 64 79
0 1 2 3 4 5 6 7 8 9 A B C D E F
0000 46 00 00 00 7d 01 00 3d 00 3b 00 00 00 01 08 00
0010 00 80 00 00 00 00 ae 26 95 66 01 00 00 00 ed 01
0020 00 80 87 91 a3 52 8a 88 9d 52 00 10 00 00 00 00
0030 00 00 00 00 04 00 72 6f 6f 74 04 00 72 6f 6f 74
0040 04 00 72 6f 6f 74
<<< RSTAT sz=3b type=0 dev=801 qid=80.1669526ae.0
<<< mode=800001ed atime=52a39187 mtime=529d888a length=1000
<<< name= uid=root gid=root muid=root extension=((null))
<<< uid=-1 gid=-1 n_muid=-1
erl
Erlang R16B01 (erts-5.10.2) [source-bdf5300] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.2 (abort with ^G)
1> crypto:start().
ok
2> H = crypto:hmac_init(sha, "test").
<<128,144,53,134,175,127,0,0,128,144,53,134,175,127,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,...>>
3> H2 = crypto:hmac_update(H, "hello world").
result on client:
> free -m
total used free shared buffers cached
Mem: 7680 5190 2489 629 40 939
-/+ buffers/cache: 4211 3469
Swap: 0 0 0
> erl
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10]
2> redbug:start("lists:nth -> return").
{30,1}
3> lists:nth(5, [a, b, c, d]).
13:29:13 <0.33.0>(dead) {lists,nth,[5,[a,b,c,d]]}
13:29:13 <0.33.0>(dead) {lists,nth,[4,[b,c,d]]}
13:29:13 <0.33.0>(dead) {lists,nth,[3,[c,d]]}
var MyApp = angular.module('MyApp');
MyApp.factory('msgBus', ['$rootScope', function($rootScope) {
var msgBus = {};
msgBus.emitMsg = function(msg, data) {
data = data || {};
$rootScope.$emit(msg, data);
};
msgBus.onMsg = function(msg, func, scope) {
var unbind = $rootScope.$on(msg, func);
if (scope) {