This file contains hidden or 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
- before :all do | |
- @account = Account.make! :user => $user | |
- @card = Card.make! :account => @account, :state => 'active' | |
- end | |
+ | |
+ let!(:account) { Account.make! :user => $user } | |
+ let!(:card) { Card.make! :account => account, :state => 'active' } | |
+ |
This file contains hidden or 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
Started GET "/product_proposals/graphic_proposals/personal?_=1351778837215" for 127.0.0.1 at 2012-11-01 16:07:17 +0200 | |
ActionController::RoutingError (No route matches [GET] "/product_proposals/graphic_proposals/personal"): | |
actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' | |
actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' | |
railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app' | |
railties (3.2.8) lib/rails/rack/logger.rb:16:in `call' | |
quiet_assets (1.0.1) lib/quiet_assets.rb:20:in `call_with_quiet_assets' | |
actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call' | |
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call' |
This file contains hidden or 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
c = @klass.make | |
=> #<Announcement id: nil, title: "Repellendus voluptatum cum consequatur rerum qui at...", content: "Officiis fuga aut non labore debitis vitae molestia...", date: "2012-11-07 18:29:10", created_at: nil, updated_at: nil> | |
[4] pry(#<RSpec::Core::ExampleGroup::Nested_57::Nested_1::Nested_2>)> c.attributes.slice(*@klass.restrict(@security_context).reflect_on_security[:restrictions].allowed_fields[:create].map(&:to_s)) | |
=> {"title"=> | |
"Repellendus voluptatum cum consequatur rerum qui at magnam perferendis non.", | |
"content"=> | |
"Officiis fuga aut non labore debitis vitae molestiae. Voluptatem officiis fuga iure. Dolore commodi quaerat asperiores ut. Fuga dolores laboriosam suscipit. Expedita quasi dolorum vel repudiandae iure eius enim cumque. Illum aspernatur blanditiis hic deserunt beatae. Quisquam asperiores quia ipsum similique laborum temporibus aut alias.", | |
"date"=>Wed, 07 Nov 2012 18:29:10 UTC +00:00} |
This file contains hidden or 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
— Ты Глобуса помнишь? — спросил Володин. | |
— Который банкиром стал? Помню, — ответил Колян. | |
— Я тоже помню, — сказал Шурик, отхлебывая освобождающей жидкости из своей фляжки с рельефом. — Сильно перед смертью поднялся. На "поршаке" ездил, цепи на нем по пять кусков каждая были. По телевизору показывали — спонсор, ху мо, все дела. | |
— Да, — сказал Володин, — а как в Париж приехал за кредитом, знаешь, что сделал? Пошел с их банкиром в ресторан, чтоб за столом по душам поговорить. А сам нажрался, как в "Славянском базаре", и давай орать: "официант, двух педерастов и ведро чифиря"! Он сам голубым не был, просто на зоне… | |
— Мне-то объяснять не надо. Чего дальше было? |
This file contains hidden or 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 'sinatra' | |
require 'rest-client' | |
require 'digest/sha1' | |
set :bind, '0.0.0.0' | |
set :port, 59898 | |
get '/' do | |
content_type 'text/xml' |
This file contains hidden or 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
def perform(user) | |
if user.fk | |
reply = retrive(attributes(user, :fk)) | |
else | |
reply = retrive(attributes(user)) | |
end | |
end | |
def attributes(user, fields=[:email, :last_name, :first_name, :address, :phone_code, :phone_number]) |
This file contains hidden or 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
dates.each_slice(7).with_index.with_object({date:0, visits: 0, rate: 0 }) do |(*arr, i), accumulator| | |
accumulator[:date] = arr[0][0].to_i | |
accumulator[:visits] += arr[0][1].to_i | |
accumulator[:rate] += arr[0][2].to_i | |
accumulator[:rate] / 7 if i == 7 | |
end |
This file contains hidden or 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
App.UrlNewRoute = Ember.Route.extend({ | |
setupController: function(controller, model) { | |
console.dir(1); | |
return this.store.find('UrlType').then(function(url_types) { | |
return console.dir(url_types); | |
}); | |
} | |
}); |
This file contains hidden or 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
func LoginCommand(c *cli.Context) { | |
a, _ := getInput("Plain input: ") | |
fmt.Println(a) | |
a, _ = getInput("Hidden input: ", true) | |
fmt.Println(a) | |
} | |
func getInput(a ...interface{}) (text string, err error) { | |
var isHidden bool | |
if len(a) == 2 { |
This file contains hidden or 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
func LoginCommand(c *cli.Context) string, error { | |
var password, account string | |
var err error | |
account = c.Args()[0] | |
if len(c.Args()) == 0 { | |
fmt.Print("Account: ") | |
if _, err = fmt.Scanln(&account); err == nil { | |
fmt.Print("Password: ") | |
_, err = fmt.Scanln(&password) | |
} |