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
| class Merb::BootLoader::RackUpApplication < Merb::BootLoader | |
| # Setup the Merb Rack App or read a rackup file located at | |
| # Merb::Config[:rackup] with the same syntax as the | |
| # rackup tool that comes with rack. Automatically evals the file in | |
| # the context of a Rack::Builder.new { } block. Allows for mounting | |
| # additional apps or middleware. | |
| # | |
| # ==== Returns | |
| # nil | |
| # |
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
| require "thin" | |
| module Merb | |
| module Rack | |
| class Thin < Merb::Rack::AbstractAdapter | |
| # start a Thin server on given host and port. | |
| # :api: plugin |
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
| chars = "hullo".tap { |x| puts "original -- #{x.inspect}" }. | |
| each_char.tap { |x| puts "each_char -- #{x.inspect}" }. | |
| each_char.select{|x| x.inspect 'l'}.tap {|x| puts "chained each_char() and select() -- #{x.inspect}" } |
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
| #!/usr/bin/python | |
| import urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| import re | |
| resp = urllib2.urlopen('http://kuumbwajazz.org/concerts') | |
| html = resp.read() | |
| soup = BeautifulSoup(html) | |
| el = soup("meta", content=re.compile(".*"))[0]['content'] |
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 A | |
| # allows methods to be namespaced as A.foo, A.bar, etc... | |
| # encapsulation still works | |
| extend self | |
| def foo | |
| "This is foo calling baz: #{baz}" | |
| end | |
| def bar |
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
| Feature: The Idea Center is for users to share ideas, get feedback on them, and provoke people to launch software projects based on them. | |
| In order to get users to give me feedback on my idea | |
| As an innovator | |
| I want users to be able to comment, vote, and share my idea on the web | |
| Scenario: A non-member views "Sock Find-o-matic" idea | |
| Given I am not a member of "Sock Find-o-matic" | |
| When I am viewing the "Sock Find-o-matic" idea page | |
| Then I should not be able to edit the wiki | |
| And I should not be able to upload an attachment |
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
| # I can't imagine a more horrible way to do HTML, so awesome! | |
| from horsepyss import HorsePyss | |
| from horsepyss.htmltools import * | |
| class html(HorsePyss): | |
| self.config = { | |
| "css": "media/css", | |
| "js": "media/js", | |
| } |
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
| # inspired somehow by kennyshen, though if I were him I'd want no association with this | |
| # CSS as Python | |
| from hiss import HissBuilder, HissStyle | |
| from hiss.tools import * | |
| blue = "#0000fb" | |
| class funky(HissStyle): |
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
| <!DOCTYPE html> | |
| <head> | |
| <script src="http://www.google.com/jsapi" language="javascript"></script> | |
| <script language="javascript"> | |
| google.load("jquery", "1.4.2") | |
| </script> | |
| <style> | |
| #img-carousel { | |
| height: 100px; | |
| width: 700px; |