Skip to content

Instantly share code, notes, and snippets.

@cdb
cdb / middleware.js
Last active September 24, 2022 00:10
Deno.core.print("Middleware loaded\n");
export function RequestHandler(/*req, res*/) {
//req.headers.set("X-Request-Middleware", "true");
Deno.core.print("Request middleware\n");
Deno.core.print("from a gist\n");
};
export function ResponseHandler(/*req, res*/) {
Deno.core.print("Response middleware\n");
runjs.addHeader("x-header-from-middleware", "hello from a gist");
};

This is my activity

Keybase proof

I hereby claim:

  • I am cdb on github.
  • I am coderdaddy (https://keybase.io/coderdaddy) on keybase.
  • I have a public key whose fingerprint is C920 10DD 440D 31C5 F6F6 245B 527E 12E1 5138 B9D6

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am cdb on github.
  • I am coderdaddy (https://keybase.io/coderdaddy) on keybase.
  • I have a public key ASAomLU8WCpiq8IOR8x1NBQ53NRrpYyU4sckIGWoXmVaxAo

To claim this, I am signing this object:

--type-add=ruby=.haml,.rake,.rsel,.builder
--type-add=html=.html.erb,.html.haml
--type-add=js=.js.erb
--type-add=yaml=.production,.staging,.erb
--type-add=css=.sass
--type-set=cucumber=.feature
@cdb
cdb / gist:81291
Created March 18, 2009 18:13
maybe fixes a small error in facebooker facebook_pretty_errors.rb
class ActionController::Base
def rescues_path_with_facebooker(template_name)
if pretty_facebook_errors?
t = "#{RAILS_ROOT}/vendor/plugins/facebooker/templates/#{template_name}.erb"
File.exist?(t) ? t : rescues_path_without_facebooker(template_name)
else
rescues_path_without_facebooker(template_name)
end
end
alias_method_chain :rescues_path, :facebooker
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Activity do
it_should_belong_to :goal
it_should_validate_presence_of :goal_id, :date
end