Skip to content

Instantly share code, notes, and snippets.

View rubenfonseca's full-sized avatar

Ruben Fonseca rubenfonseca

View GitHub Profile
<?xml version="1.0"?>
<GMSResponse>
<login success="true" hasupdate="true"/>
<screen id="homepage">
...
</screen>
<tabs>
<tab icon="icon_selfcare_tab" title="Gest&#xE3;o de Conta" screenid="selfcare"/>
<tab icon="icon_services_tab" title="Servi&#xE7;os" screenid="serv_list"/>
<tab icon="icon_rateplan_tab" title="Tarif&#xE1;rios" screenid="rateplan"/>
@rubenfonseca
rubenfonseca / app.js
Created July 13, 2011 20:48
Google Analytics Module
var google_analytics = require('com.0x82.google.analytics');
google_analytics.addEventListener('complete', function(e) {
Ti.API.log(e);
});
google_analytics.startTracker({
accountID: 'UA-2061857-1',
debug: true
});
Biscates.Location = (function() {
var WATCH_ID;
var POSITION;
var GEOLOCATION_OPTIONS = {
enableHighAccuracy: true,
maximumAge: 600000,
timeout: 30000 // 30 seconds
};
function _initGeolocation() {
require 'rubygems'
require 'oauth'
require 'json'
consumer = OAuth::Consumer.new 'ds1UTK4sT3R5MVhYIYV6w', 'RtqyirueGdzUt0tpbuuYnZAxUv71E3xrxxpfnkxt4', { :site => 'http://hireme.goplanapp.com' }
req = consumer.get_request_token
puts req.authorize_url
sleep 20
require 'rubygems'
require 'oauth'
consumer = OAuth::Consumer.new 'ds1UTK4sT3R5MVhYIYV6w', 'RtqyirueGdzUt0tpbuuYnZAxUv71E3xrxxpfnkxt4', { :site => 'http://hireme.goplanapp.com' }
request = consumer.get_request_token
puts request.authorize_url
sleep 20 # give us time to authenticate
@rubenfonseca
rubenfonseca / _form.html.haml
Created October 27, 2010 22:24
user has_many groups
- form_for @user do |f|
.small= f.error_messages
%fieldset
%legend= t(:please_fill_the_following_fields)
.box
= f.label :name, User.human_attribute_name(:name)
= f.text_field :name, :style => 'width: 500px'
We couldn’t find that file to show.
require 'rubygems'
require 'activity_streams'
require 'open-uri'
twitter = 'http://api.cliqset.com/feed/?svcuser=rubenfonseca&feedid=twitternotesposted'
feed = ActivityStreams::Feed.from_xml(open(twitter).read)
feed.entries.size #=> 20
feed.entries.first.verbs.size #=> 1
feed.entries.first.verbs.first #=> "http://activitystrea.ms/schema/1.0/post"
Trying on GeForce 9400 GT NVIDIA OpenCL 1.0 [gpu]
1073741824.0
Trying on GeForce 9400 GT NVIDIA OpenCL 1.0 [gpu]
1073741824.0
Trying on Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz Intel OpenCL 1.0 [cpu]
1073741824.0
@rubenfonseca
rubenfonseca / test_macruby_opencl.rb
Created January 23, 2010 20:25
OpenCL Macruby Example
OpenCL.devices.each do |device|
info = device.info
puts "Trying on #{info[:name]} #{info[:vendor]} #{info[:version]} [#{info[:type]}]"
context = device.create_context
queue = context.create_command_queue
program = context.create_program <<EOF
// OpenCL kernel that computes the square of an input array
__kernel square(
__global float* input,