Skip to content

Instantly share code, notes, and snippets.

View gist:146481
var Todo = new Class({
Implements: [Options],
options: {},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.initFields();
this.addEventHandlers();
this.initButtons();
View gist:165363
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"
View gist:172839
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
View gist:457825
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
View Slick.Finder.diff
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){
-
+
View With Grep
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
View amqp-evented-spec-hello-world.rb
require 'spec_helper'
require 'evented-spec'
describe "Hello, world! example" do
include EventedSpec::AMQPSpec
it "should pass" do
done
end
end
View amqp-evented-spec-hello-world-2.rb
require 'spec_helper'
require 'evented-spec'
describe "Hello, world! example" do
include EventedSpec::AMQPSpec
default_options :vhost => "amqp_testing_vhost"
default_timeout 1
View amqp-evented-spec-3.rb
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
View amqp-evented-spec-delayed-4.rb
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) {