Skip to content

Instantly share code, notes, and snippets.

View whoahbot's full-sized avatar

Dan Herrera whoahbot

  • Portland, Oregon
View GitHub Profile
//
// TrollopsViewController.m
// Trollops
//
// Created by dph on 3/16/09.
// Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import "TrollopsViewController.h"
#import "TrollopView.h"
=INFO REPORT==== 2009-03-31 03:00:52 ===
I(<0.253.0>:ejabberd_listener:116) : (#Port<0.5709>) Accepted connection {{67,189,35,116},45469} -> {{174,143,25,47},5280}
=INFO REPORT==== 2009-03-31 03:00:52 ===
D(<0.246.0>:ejabberd_http:121) : S: [{["admin"],ejabberd_web_admin},
{["http-bind"],mod_http_bind},
{["http-poll"],ejabberd_http_poll}]
=INFO REPORT==== 2009-03-31 03:00:52 ===
{5280, ejabberd_http, [
http_bind,
http_poll,
web_admin
]}
<VirtualHost *>
Servername whoahbot.example.com
DocumentRoot /var/www
RewriteEngine On
RewriteRule ^/http-bind/ http://jabber.example.com:5280/http-bind/ [P]
</VirtualHost>
$(function() {
$('.login_button').click(function() {
doLogin();
});
$('#send_chat_form').submit(function() {
var message = $(this).find('.message').val();
sendMsg(message);
$('#chat').append('<div class="msg">me: ' + message + '</div>');
$(this).find(".message").val('');
var packet = new JSJaCPresence();
packet.setTo("#[email protected]/whoahbot");
packet.appendNode('x', {xmlns: "http://jabber.org/protocol/muc"});
function doLogin(form) {
$('#log').html('');
try {
oArgs = new Object();
oArgs.httpbase = 'http://whoahbot.example.com/http-bind/';
oArgs.timerval = 2000;
con = new JSJaCHttpBindingConnection(oArgs);
function sendMsg(message) {
try {
var aMsg = new JSJaCMessage();
aMsg.setTo(new JSJaCJID("#[email protected]/whoahbot"));
aMsg.setType('groupchat');
aMsg.setBody(message);
con.send(aMsg);
} catch (e) {
$('#chat').html("<div class='msg error''>Error: "+ e.message +"</div>");
}
From e9aea3f6b29b2803221dbfacdb239a9f1599b2d5 Mon Sep 17 00:00:00 2001
From: Whoahbot <[email protected]>
Date: Tue, 5 May 2009 15:56:40 -0700
Subject: [PATCH] Adding in translations for before_type_cast, fixes a bug with rails formbuilder
---
lib/globalize/model/active_record.rb | 4 +++-
test/model/active_record/translated_test.rb | 5 +++++
2 files changed, 8 insertions(+), 1 deletions(-)
def records_for(query)
set = @redis.set_members("#{query.model}:#{redis_key_for(query.model)}:all")
arr = Array.new(set.size)
set.each_with_index do |val, i|
arr[i] = {"#{redis_key_for(query.model)}" => val.to_i}
end
arr
end