Skip to content

Instantly share code, notes, and snippets.

var Todo = new Class({
Implements: [Options],
options: {},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.initFields();
this.addEventHandlers();
this.initButtons();
class Blogs < Application
before :ensure_authenticated
before :find_blogs, :only => :index
before :find_blog, :only => [:show, :edit, :update]
before :create_blog, :only => [:create, :new]
before :find_posts, :only => :show
def nav
return "blogs/nav" if !['index','new'].include?(params[:action]) && @blog.author == session.user
"layout/nav"
upstream merb {
server 127.0.0.1:4000;
}
server {
listen 80;
server_name orwik.local *.orwik.local;
# serve stylesheets/vendor, that is known to be pure CSS, directly
describe MyController, "GET index" do
let(:cookie_value) { "of course" }
it "should delete the cookie" do
request.cookies[:awesome] = cookie_value
get :index
cookies[:awesome].should == cookie_value
end
end
@markiz
markiz / Slick.Finder.diff
Created December 14, 2010 13:11
Proof of concept: Slick can do it even faster
diff --git a/Source/Slick/Slick.Finder.js b/Source/Slick/Slick.Finder.js
index 3034d81..2fb6cf8 100644
--- a/Source/Slick/Slick.Finder.js
+++ b/Source/Slick/Slick.Finder.js
@@ -64,9 +64,9 @@ local.setDocument = function(document){
} catch(e){};
if (this.isHTMLDocument){
-
+
Provides: [Widgets/LSD.Widget.Anchor]
Provides: [Widgets/LSD.Widget.Anchor]
Provides: [Widgets/LSD.Widget.Anchor]
Provides: [Widgets/LSD.Widget.Body.Dialog]
Provides: [Widgets/LSD.Widget.Body.Dialog]
Provides: [Widgets/LSD.Widget.Body.Dialog]
Provides: [Widgets/LSD.Widget.Body.Page]
Provides: [Widgets/LSD.Widget.Body.Page]
Provides: [Widgets/LSD.Widget.Body.Page]
Provides: [Widgets/LSD.Widget.Body]
@markiz
markiz / amqp-evented-spec-hello-world.rb
Created June 15, 2011 15:43
Hello, world! spec example for AMQP
require 'spec_helper'
require 'evented-spec'
describe "Hello, world! example" do
include EventedSpec::AMQPSpec
it "should pass" do
done
end
end
require 'spec_helper'
require 'evented-spec'
describe "Hello, world! example" do
include EventedSpec::AMQPSpec
default_options :vhost => "amqp_testing_vhost"
default_timeout 1
require 'spec_helper'
describe "Topic-based subscription" do
include EventedSpec::AMQPSpec
default_timeout 1
amqp_before do
# initializing amqp channel
@channel = AMQP::Channel.new
# using default amqp exchange
require 'spec_helper'
describe AMQP do
include EventedSpec::AMQPSpec
default_timeout 5
context "when queue is redeclared with different attributes across two channels" do
let(:name) { "amqp-gem.nondurable.queue" }
let(:options) {