Skip to content

Instantly share code, notes, and snippets.

Joachim Nolten stiller

Block or report user

Report or block stiller

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View AST XPath article
require 'parser/current'
require 'rexml/document'
class XMLAST
include REXML
attr_reader :doc
def initialize sexp
@doc = Document.new "<root></root>"
@sexp = sexp
View keybase.md

Keybase proof

I hereby claim:

  • I am stiller on github.
  • I am joachim (https://keybase.io/joachim) on keybase.
  • I have a public key whose fingerprint is B0B4 EDA7 1F9D A7C8 19F0 31A7 4D7C 27F5 4637 0D05

To claim this, I am signing this object:

View gist:1affea2647c5083a4366
### Keybase proof
I hereby claim:
* I am stiller on github.
* I am joachim (https://keybase.io/joachim) on keybase.
* I have a public key whose fingerprint is E9B5 E7BF 07D8 D78A 0527 E737 3225 1732 D79B E6D7
To claim this, I am signing this object:
@stiller
stiller / rate-limit-routes.rb
Created Jun 13, 2012
Rate limiting specific Rails routes
View rate-limit-routes.rb
class RateConstraint
def matches?(request)
last_request = request.session[:request_time]
request.session[:request_time] = Time.now
!(last_request and (Time.now - last_request < 2.second))
end
end
Application.routes.draw do
constraints RateConstraint.new do
You can’t perform that action at this time.