This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonProtect | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
dup._call(env) | |
end | |
def _call(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
branches = `git branch`.chomp.split("\n") | |
branches.map!(&:strip) | |
branches.each do |branch| | |
puts "================================" | |
puts "Considering: #{branch}" | |
puts | |
system "git log --color --stat -n 1 #{branch}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
namespace :foo do | |
match '/' => 'main#index' | |
resources :bar | |
resources :baz | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.middleware.use Rack::Bug, | |
:secret_key => "moje_tajne_haslo", | |
:panel_classes => [ | |
Rack::Bug::TimerPanel, | |
Rack::Bug::ActiveRecordPanel, | |
Rack::Bug::CachePanel, | |
Rack::Bug::SQLPanel, | |
Rack::Bug::TemplatesPanel, | |
Rack::Bug::LogPanel, | |
Rack::Bug::MemoryPanel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= cache('your_cache_key', :expires_in => 3.hours) do %> | |
<!-- computation heavy stuff goes here %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActionController | |
class AbstractRequest | |
class << self | |
def parse_query_parameters(query_string) | |
return {} if query_string.blank? | |
query_string = query_string.gsub("amp;", "") | |
pairs = query_string.split('&').collect do |chunk| | |
next if chunk.empty? | |
key, value = chunk.split('=', 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"email" => "moj@mejl.pl", "amp;name" => "Stefan"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
will_paginate @comments, | |
:prev_label => '« poprzedni', | |
:next_label => 'następny »' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="pagination"> | |
<li class="select">1</li> | |
<li><a href="/users/john/komentarze?page=2">2</a></li> | |
<li><a href="/users/john/komentarze?page=3">3</a></li> | |
<li><a href="/users/john/komentarze?page=4">4</a></li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="pagination"> | |
<li class="select">1</li> | |
<li><a href="/users/john/komentarze?page=2">2</a></li> | |
<li><a href="/users/john/komentarze?page=3">3</a></li> | |
<li><a href="/users/john/komentarze?page=4">4</a></li> | |
</ul> |