Skip to content

Instantly share code, notes, and snippets.

View lfcipriani's full-sized avatar
💪
www.beat81.com

Luis Cipriani lfcipriani

💪
www.beat81.com
View GitHub Profile
#define lll h>
#define ll1l <stdlib
#define ll11 <time
#define l11l time
#define l1l1 <stdio
#define l1ll sleep
#define False 1111.111
#define inc1ude2 ll1l.lll
#define includeZ ll11.lll
#define include2 l1l1.lll
@lfcipriani
lfcipriani / gist:1170628
Created August 25, 2011 13:19
Error trying to start pseudo distributed HBase on CentOS
hadoop: 0.20.203.0
hbase: 0.90.4
system: CentOS release 5.6 (Final) Linux 2.6.18-238.19.1.el5
HDFS is running fine (tested)
------------ hbase-site.xml
<configuration>
<property>
@lfcipriani
lfcipriani / hbase_pseudo_distributed.pp
Created January 6, 2012 18:23
Puppet manifest for a pseudo distribute HBase (using Cloudera distribution in a CentOS)
# Pseudo distributed Hbase install (using Cloudera distribution)
# (all daemons running in one machine)
#
# Parameters:
# $java_installer = Oracle's java rpm.bin file, recommended by Cloudera
# Requires:
# java installer downloaded and present
#
# Parameter
@lfcipriani
lfcipriani / gist:2417802
Created April 19, 2012 01:47
xmpp presence stanza
<presence from="cipriani@talleye.com/casa">
<status>Ouvindo música...</status>
</presence>
@lfcipriani
lfcipriani / gist:2417804
Created April 19, 2012 01:48
message xmpp stanza
<message to="pedro@shorteye.com/escitorio"
from="cipriani@talleye.com/casa"
type="chat" >
<body>Cadê você?</body>
</message>
@lfcipriani
lfcipriani / gist:2417815
Created April 19, 2012 01:49
iq xmpp stanza
<iq type="set" id="an_id"
from="cipriani@talleye.com/casa"
to="talleye.com">
<query xmlns="jabber:iq:roster"/>
</iq>
@lfcipriani
lfcipriani / config.js
Created April 19, 2012 03:01
config.js
// config.js
var Config = {
API_KEY: 'YOUR_COLLECTA_API_KEY',
BOSH_SERVICE: 'http://collecta.com/xmpp-httpbind',
HOST: "guest.collecta.com"
};
@lfcipriani
lfcipriani / real-time-comparison.js
Created April 19, 2012 03:02
real-time-comparison.js
// initiating a BOSH connection to create an anonymous connection to the Collecta XMPP server
connection = new Strophe.Connection(Config.BOSH_SERVICE);
connection.connect(Config.HOST, null, onConnect);
@lfcipriani
lfcipriani / real-time-comparison.js
Created April 19, 2012 03:03
real-time-comparison.js 2
// real-time-comparison.js
function onConnect(status)
{
if (status == Strophe.Status.CONNECTING) {
// ... outros status
} else if (status == Strophe.Status.CONNECTED) {
// adding one handler for each type of XMPP stanza
connection.addHandler(onPresence, null, 'presence', null, null, null);
connection.addHandler(onIq, null, 'iq', null, null, null);
connection.addHandler(onMessage, null, 'message', null, null, null);
function onPresence(prs) {
// in this case, presence got from the XMPP server means to activate UI and allow user to enter the 2 terms to compare
console.log("Got presence!");
anonymous_jid = $(prs).attr('to');
// ... outras coisas
return true;
}