Skip to content

Instantly share code, notes, and snippets.

View deepthawtz's full-sized avatar
👩‍🎤
singin'

Dylan Clendenin deepthawtz

👩‍🎤
singin'
  • Venmo
  • San Francisco, CA
View GitHub Profile
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
#
require "thin"
module Merb
module Rack
class Thin < Merb::Rack::AbstractAdapter
# start a Thin server on given host and port.
# :api: plugin
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}" }
#!/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']
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
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
# 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",
}
# 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):
<!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;