Skip to content

Instantly share code, notes, and snippets.

###
### ejabberd configuration file
###
###
### The parameters used in this configuration file are explained in more detail
### in the ejabberd Installation and Operation Guide.
### Please consult the Guide in case of doubts, it is included with
### your copy of ejabberd, and is also available online at
### http://www.process-one.net/en/ejabberd/docs/
@developerworks
developerworks / basic.html
Created September 29, 2014 16:48
Strophe.js Client Code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Content-Language" content="zh-CN"/>
<title>Strophe.js Basic Example</title>
<script src='jquery.min.js'></script>
<script src='../strophe.js'></script>
<script src='basic.js'></script>
<script src="basic_lab.js"></script>
@developerworks
developerworks / mod_muc_member_list.erl
Created September 29, 2014 19:21
Ejabberd module: get room members
%% 参考资源
%% https://www.ejabberd.im/node/4159?q=node/4159
%% http://blog.zlxstar.me/blog/2013/07/21/dicorvery-user-muclist/
-module(mod_muc_member_list).
-author('hezhiqiang').
-behaviour(gen_mod).
-include("ejabberd.hrl").
-include("jlib.hrl").
-include("logger.hrl").
-define(NS_MUC_MEMBER_LIST, <<"http://jabber.org/protocol/muc#member-list">>).
/* global Application, ObjC, $ */
/**
* repozish.js
*
* this is an example of using os x yosemite's "JavaScript for Automation":
*
* https://developer.apple.com/library/prerelease/mac/releasenotes/interapplicationcommunication/rn-javascriptforautomation/index.html
*
* it repositions some windows based on some position settings. you can run
@developerworks
developerworks / register_jquery.min.js
Created October 3, 2014 12:42
Register user with strophe.js and strophe.register.js plugin.
/*
* jQuery 1.2.6 - New Wave Javascript
*
* Copyright (c) 2008 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* $Date: 2008/05/26 $
* $Rev: 5685 $
*/
@developerworks
developerworks / mod_system_information.erl
Created October 4, 2014 12:12
mod_system_information.erl
%%%----------------------------------------------------------------------
%%% File : mod_onlineusers.erl
%%% Author : Michael Weibel <michael.weibel@amiadogroup.com>
%%% Purpose : Display number of online users
%%% Created : 2011-08-16
%%%----------------------------------------------------------------------
%%% https://github.com/candy-chat/mod_onlineusers
%%% http://blog.zlxstar.me/blog/2013/07/21/dicorvery-user-muclist
-module(mod_cputime).
-behaviour(gen_mod).
-export([
start/2,
stop/1,
process_local_iq/3
]).
-include("ejabberd.hrl").
-include("jlib.hrl").
-include("logger.hrl").
@developerworks
developerworks / mod_logxml.erl
Created October 15, 2014 08:55
Ejabberd module: log message,iq,presence stanza to a xml log file.
-module(mod_logxml).
-author('badlop@ono.com').
-behaviour(gen_mod).
-export([
start/2,
init/7,
stop/1,
send_packet/3,
receive_packet/4
]).
// Load data tiles from an AJAX data source
L.TileLayer.Ajax = L.TileLayer.extend({
_requests: [],
_addTile: function (tilePoint) {
var tile = { datum: null, processed: false };
this._tiles[tilePoint.x + ':' + tilePoint.y] = tile;
this._loadTile(tile, tilePoint);
},
// XMLHttpRequest handler; closure over the XHR object, the layer, and the tile
_xhrHandler: function (req, layer, tile, tilePoint) {
@developerworks
developerworks / xml_parsing_test.exs
Last active July 4, 2016 17:55
在Elixir中解析XML文档
defmodule XmlParsingTest do
@moduledoc """
从xmerl模块头文件中提取XML元素记录
我们要提取的两个记录在xmerl.hrl中的定义分别为
- xmlElement
```
-record(xmlElement,{
name, % atom()
expanded_name = [], % string() | {URI,Local} | {"xmlns",Local}
nsinfo = [], % {Prefix, Local} | []