Skip to content

Instantly share code, notes, and snippets.

View julien51's full-sized avatar

Julien Genestoux julien51

View GitHub Profile
puts "yo!"
<% fields_for @public_key do |f| -%>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %><br /><br />
</p>
<p>
<%= f.label :key %><br />
<%= f.text_area :key %>
</p>
<% end -%>
require 'rubygems'
require 'eventmachine'
require 'open-uri'
require 'libxml'
class XmlHandler
include LibXML::XML::SaxParser::Callbacks
irb(main):001:0> class Cool; def moo; 5; end; def do; moo; end end
=> nil
irb(main):002:0> module Zoop; def moo; 4; end end
=> nil
irb(main):003:0> class Za < Cool; alias_method :rawr, :moo; include Zoop; end
=> Za
irb(main):004:0> Za.new.moo
=> 4 # Ok
irb(main):005:0> Za.new.rawr
=> 5 # Ok
require "rubygems"
require "nokogiri"
require "eventmachine"
##
# This is the XML SAX Parser that accepts "pushed" content used by Babylon Gem.
class XmppParser < Nokogiri::XML::SAX::Document
##
# Initialize the parser and adds the callback that will be called upen stanza completion
require "rubygems"
require "nokogiri"
require 'dike'
Dike.logfactory '/tmp/dikelogfactory/'
class ZipZap
attr_reader :zip, :zap
def initialize
@zip = "zip"
@zap = "zap"
---
- class: Nokogiri::XML::Builder
count: 9
trace:
- builder.rb:40:in `evaluate'
- builder.rb:73
- builder.rb:50:in `times'
- builder.rb:50
- class: View
count: 9
@julien51
julien51 / subscribe.xml
Created April 21, 2009 21:35
Subscription Request to a Feed with Superfeedr
<iq type='set' from='you@superfeedr.com/home' to='firehoser.superfeedr.com' id='sub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe node='http://domain.tld/path/to/feed1.xml' jid='you@superfeedr.com'/>
<subscribe node='http://domain.tld/path/to/feed2.xml' jid='you@superfeedr.com'/>
<subscribe node='http://domain.tld/path/to/feed3.xml' jid='you@superfeedr.com'/>
</pubsub>
</iq>
<iq type='error'
from='firehoser@superfeedr.com'
to='you@superfeedr.com'
id='sub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe
node='http://domain.tld/path/to/feed.xml'
jid='firehoser@superfeedr.com'/>
</pubsub>
<error type='modify'>
@julien51
julien51 / subscription_success.xml
Created April 21, 2009 21:49
Successful Subscription to a Feed with Superfeedr
<iq type="result" to="you@superfeedr.com/home" from="firehoser.superfeedr.com" id="sub1">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<subscription jid="you@superfeedr.com" subscription="subscribed" node="http://domain.tld/path/to/feed1.xml"/>
<subscription jid="you@superfeedr.com" subscription="subscribed" node="http://domain.tld/path/to/feed2.xml"/>
<subscription jid="you@superfeedr.com" subscription="subscribed" node="http://domain.tld/path/to/feed3.xml"/>
</pubsub>
</iq>