Skip to content

Instantly share code, notes, and snippets.

@rfunduk
rfunduk / awesome.rb
Created July 21, 2008 02:08
#44! :P
RubyFringe.teh_awesome? # => true
# http://use.perl.org/~Ovid/journal/39301
module MixinUpper
def a; 'A'; end
def b; 'B'; end
end
module MixinLower
def a; 'a'; end
def b; 'b'; end
<form id="comment_form"
action="/cgi-bin/comment.py"
method="post">
Full Name: <input name="full_name" /><br/>
Email <small>(optional)</small>: <input name="email" /><br/>
Subject: <select name="subject">
<option selected value="Comment">Comment</option>
<option value="Complaint">Complaint</option>
<option value="Question">Question</option>
</select><br/>
import flash.display.Graphics;
import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.events.MouseEvent;
[Embed(source='overlay.png')]
private var Overlay:Class;
private var g:Graphics;
private var bmd:BitmapData;
html {
overflow-y: scroll;
}
// Note: The functions should be wrapped in "double quotes" the
// same as the keys, I've removed them here for syntax
// highlighting purposes.
{
"_id": "_design/ratings",
"views": {
"by_permalink": {
"reduce": function( keys, values ) {
return sum( values ) / values.length;
$(this).siblings('pre').slideDown( event.shiftKey ? 4000 : 'fast' );
class Document
class NotFound < StandardError; end
class InvalidFieldName < StandardError; end
@@__cache = {}
@@connection = nil
@@database_name = nil
@@database = nil
def self.cached
# aptitude remove apache2-mpm-worker
# aptitude install apache2-mpm-prefork
# aptitude install apache2-prefork-dev
module Comfy
class Database
# we'll use some other Comfy:: classes here
include Comfy
def initialize( name )
# setup the instance using 'name'
end
end
end