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
require 'spec_helper' | |
describe Users do | |
describe 'Update user' do | |
let(:user) { FactoryGirl.create(:user) } | |
let(:image) { | |
Rack::Test::UploadedFile.new('spec/fixtures/images/treme.jpg', 'image/jpeg') | |
} |
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
site :opscode | |
cookbook 'apt' | |
cookbook 'database' | |
cookbook 'set_locale', path: './cookbooks/set_locale' | |
cookbook 'postgresql_server_utf8', path: './cookbooks/postgresql_server_utf8' |
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
site :opscode | |
cookbook 'apt' | |
cookbook 'locale' | |
cookbook 'mysql' |
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
defmodule Rosalind do | |
defp codon_table do | |
[ | |
UUU: 'F', UUU: 'L', AUU: 'I', GUU: 'V', | |
UUC: 'F', CUC: 'L', AUC: 'I', GUC: 'V', | |
UUA: 'L', CUA: 'L', AUA: 'I', GUA: 'V', | |
UUG: 'L', CUG: 'L', AUG: 'M', GUG: 'V', | |
UCU: 'S', CCU: 'P', ACU: 'T', GCU: 'A', | |
UCC: 'S', CCC: 'P', ACC: 'T', GCC: 'A', |
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 MyFancyTool | |
module TestSupport | |
module ArubaExt | |
def with_redirected_stdout(&block) | |
redirect_stdout | |
yield | |
bring_back_stdout | |
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
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
/* Parse JSON hijacking protected strings: while(1);{ "foo": 1 } */ | |
(function() { | |
var SECURITY_REG_EXP = /^while\(1\);([\s\S]*)\s*$/, | |
ORIGINAL_PARSEJSON = $.parseJSON; | |
$.extend($, { | |
stripSecurity: function(string) { | |
return string.replace(SECURITY_REG_EXP, "$1"); | |
}, |
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 |
NewerOlder