Skip to content

Instantly share code, notes, and snippets.

View rubenfonseca's full-sized avatar

Ruben Fonseca rubenfonseca

View GitHub Profile
diff -ur twinkle-1.4.2/src/protocol.h twinkle-1.4.2_new/src/protocol.h
--- twinkle-1.4.2/src/protocol.h 2009-01-03 16:53:58.000000000 +0000
+++ twinkle-1.4.2_new/src/protocol.h 2009-05-23 15:04:47.000000000 +0100
@@ -29,7 +29,7 @@
#define TCP_PING_PACKET CRLF CRLF
/** Product name */
-#define PRODUCT_NAME "Twinkle"
+#define PRODUCT_NAME "Optimus-SoftPhone"
<item>
<title>Tiago Farrajota: Nova Gente diz: Queda do 447 com sobreviventes</title>
<link>http://www.prt.sc/r/post/40da93130f223c99c207485bb1b46227/</link>
<description>&lt;img src="http://prt.sc/media/mugshots/tiago_farrajota.png" alt="Tiago Farrajota" align="right" style="float:right;""&gt;&lt;br&gt;
&lt;p&gt;&lt;img src="http://tiagofarrajota.com/imagens/novagentequeda.jpg" /&gt;&lt;/p&gt;
&lt;img src="http://feeds2.feedburner.com/~r/tiagofarrajota/~4/L73vzTk6SpU" height="1" width="1" /&gt;</description>
<author>Tiago Farrajota</author>
<pubDate>Sun, 07 Jun 2009 19:06:52 -0000</pubDate>
<guid>http://www.prt.sc/r/post/40da93130f223c99c207485bb1b46227/</guid></item>
class User < ActiveRecord::Base
acts_as_authentic do |c|
c.validate_login_field = false
# optional, but if a user registers by openid, he should at least share his email-address with the app
c.validate_email_field = false
# fetch email by ax
c.openid_required_fields = [:email, "http://axschema.org/contact/email"]
# fetch email by sreg
c.openid_optional_fields = ["email"]
end
% brew list pkg-config
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/AUTHORS
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/bin/pkg-config
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/ChangeLog
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/COPYING
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/README
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/share/aclocal/pkg.m4
/Users/rubenfonseca/luser/homebrew/Cellar/pkg-config/0.23/share/man/man1/pkg-config.1
checking pkg-config is at least version 0.7... yes
checking for GLIB - version >= 2.6.0... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GLIB is incorrectly installed.
*** trying without -lgmodule
checking for pkg-config... (cached) /Users/rubenfonseca/luser/homebrew/bin/pkg-config
checking pkg-config is at least version 0.7... yes
checking for GLIB - version >= 2.6.0... no
*** Could not run GLIB test program, checking why...
configure:24371: gcc-4.2 -o conftest -O3 -march=nocona -mfpmath=sse -mmmx -msse4.1 -w -pipe -fomit-frame-pointer -mmacosx-version-min=10.5 -Wall -I/Users/rubenfonseca/luser/homebrew/Cellar/glib/2.20.5/include/glib-2.0 -I/Users/rubenfonseca/luser/homebrew/Cellar/glib/2.20.5/lib/glib-2.0/include -I/Users/rubenfonseca/luser/homebrew/include -L/Users/rubenfonseca/luser/homebrew/lib conftest.c -L/Users/rubenfonseca/luser/homebrew/Cellar/glib/2.20.5/lib -lglib-2.0 -lintl >&5
ld: library not found for -lintl
collect2: ld returned 1 exit status
require 'mq'
require 'twitter/json_stream'
username = ARGV.shift
password = ARGV.shift
raise "need username and password" if !username or !password
AMQP.start(:host => 'localhost') do
twitter = MQ.new.fanout('twitter')
require 'em-websocket'
require 'uuid'
require 'mq'
uuid = UUID.new
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080) do |ws|
ws.onopen do
puts "WebSocket opened"
$(document).ready(function(){
if(!("WebSocket" in window)) {
alert("Sorry, the build of your browser does not support WebSockets. Please use latest Chrome or Webkit nightly");
return;
}
ws = new WebSocket("ws://localhost:8080/");
ws.onmessage = function(evt) {
data = eval("(" + evt.data + ")");
var p = $("<div class='tweet' style='display:none'><div class='content'><a class='main-screenname' href='http://www.twitter.com/" + data.user.screen_name + "/status/" + data.id + "' target='_blank'>" + data.user.screen_name + "</a> " + data.text + "</div></div>");
@rubenfonseca
rubenfonseca / macruby_opencl_test
Created January 23, 2010 17:05
OpenCL MacRuby quick experiment
~/luser/MacRuby[master]% macruby -e 'puts OpenCL.devices.map(&:info)'
{:name=>"GeForce 9400 GT", :vendor=>"NVIDIA", :version=>"OpenCL 1.0 ", :type=>:gpu, :max_compute_units=>4, :max_work_item_dimensions=>140733193388035, :max_work_item_sizes=>[512, 512, 64], :max_work_group_size=>512, :max_clock_frequency=>1350, :address_bits=>32, :max_mem_alloc_size=>128, :global_mem_size=>512, :error_correction_support=>false, :local_mem_type=>"local", :local_mem_size=>16, :max_constant_buffer_size=>64, :queue_properties=>[:profiling_enable], :image_support=>true, :max_read_image_args=>128, :max_write_image_args=>8, :image2d_max_width=>8192, :image2d_max_height=>8192, :image3d_max_width=>2048, :image3d_max_height=>2048, :image3d_max_depth=>2048, :extensions=>"cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_APPLE_gl_sharing cl_APPLE_SetMemObjectDestructor cl_APPLE_ContextLoggingFunctions "}
{:name=>"GeForce 9400 GT", :vendor=>"NVIDIA", :version=>"OpenCL 1.0 ", :type=>:g