Skip to content

Instantly share code, notes, and snippets.

View damncabbage's full-sized avatar
🙅‍♀️
permanent omnishambles

Robin Howard damncabbage

🙅‍♀️
permanent omnishambles
View GitHub Profile

This is the code that powers the parallax effect on codetunes.com.

I think it’s quite chaotic at the moment and waits for being released as open source when it’s cleaned up.

# Consider the following
class ApplicationController < ActionController::Base
helper_method :current_filter
private
def current_filter
ActiveSupport::StringInquirer.new(params[:filter] || '')
end
end
#ruby
[1,2,3,4].select{ |x| x.even? }
#python
[x for x in [1,2,3,4] if not x%2]
#or, more norvingly
filter(lambda x: not x%2, [1,2,3,4])
#clojure
(filter #(even? % ) [1 2 3 4])