This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module JustinFrench | |
| module Formtastic | |
| class SemanticFormBuilder < JustinFrench::Formtastic::SemanticFormBuilder | |
| def initialize(*args) | |
| ::ActiveSupport::Deprecation.warn("JustinFrench::Formtastic::SemanticFormBuilder is depreciated. User Formtastic::SemanticFormBuilder instead", caller) | |
| super | |
| end | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <p> | |
| <a href="http://www.facebook.com/l.php?u=http://www.dci.org%2Fcountdown%2F" target="_blank"> | |
| <img src="http://www.facebook.com/l.php?u=http://www.dci.org%2Fimages%2F_vd%2Fcountdown%2F2009%2F2009_countdown_main.jpg" border="0"> | |
| </a> | |
| Drum Corps International’s 2009 spring cinema event "The Countdown" comes to theaters nationwide on Wednesday, May 13, and you can help us determine which corps performances will be shown up on the big screen! | |
| </p> | |
| Try that one. The difference was I removed 'align="left"' from the img tag. That will cause the image to float left and the text to flow around the right side of it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def type | |
| case attributes['type'] | |
| when 'cancel' then :cancel | |
| when 'form' then :form | |
| when 'result' then :result | |
| when 'submit' then :submit | |
| else nil | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PubSub ping pong in Blather | |
| setup 'ping-pong@jabber.local', 'ping-pong' | |
| pubsub.host = 'pubsub.jabber.local' | |
| pubsub_event :node => 'ping' do |node| | |
| pubsub.publish 'pong', node.payload | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr = [1,2,3,4,5,6,7] | |
| half = arr.size / 2 | |
| first_half = arr[0...half] | |
| last_half = arr[half..-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iq | |
| |-- pubsub | |
| | |-- pubsub_affiliations | |
| | |-- pubsub_items | |
| | `-- pubsub_subscriptions | |
| `-- query | |
| |-- disco_info | |
| |-- disco_items | |
| `-- roster | |
| message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A single ruby script that plays ping pong with itself over XMPP | |
| # That's two separate clients connected to the same server using different resource IDs | |
| # Ping will wait until it knows Pong is online, then it'll start the match | |
| require 'blather/client/dsl' | |
| $stdout.sync = true | |
| module Ping | |
| extend Blather::DSL | |
| def self.run; client.run; end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| attributes_array.each do |item| | |
| if key | |
| case key | |
| when "xmlns" | |
| e.namespaces.namespace = XML::Namespace.new(e, nil, item) | |
| when /^xmlns:(.*)$/ | |
| e.namespaces.namespace = XML::Namespace.new(e, $1, item) | |
| else | |
| e[key] = item | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <inventory xmlns="http://alicesautosupply.example.com/"> | |
| <tire name="super slick racing tire" /> | |
| <tire name="all weather tire" /> | |
| </inventory> | |
| <inventory xmlns="http://bobsbikes.com"> | |
| <tire name="narrow street tire" /> | |
| <tire name="mountain trail tire" /> | |
| </inventory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| n = Nokogiri::XML::Node.new('root', Nokogiri::XML::Document.new) | |
| n << Nokogiri::XML::Node.new('child', n.document) | |
| n << (c = Nokogiri::XML::Node.new('child', n.document)) | |
| c.default_namespace = 'foo:bar' | |
| n.search './child', {'xmlns' => 'foo:bar'} |