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
| # paths | |
| app_path = "/home/deployer/qna" | |
| working_directory "#{app_path}/current" | |
| pid "#{app_path}/current/tmp/pids/unicorn.pid" | |
| # listen | |
| listen "/tmp/unicorn.qna.sock", backlog: 64 | |
| # logging | |
| stderr_path "log/unicorn.stderr.log" |
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
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
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
| # В системе авторизации есть ограничение: | |
| # логин должен начинаться с латинской буквы, | |
| # состоять из латинских букв, цифр, точки и минуса, | |
| # но заканчиваться только латинской буквой или цифрой; | |
| # минимальная длина логина — один символ, максимальная — 20. | |
| # Напишите код, проверяющий соответствие входной строки этому правилу. Придумайте несколько способов решения задачи и сравните их. | |
| class AuthOne | |
| def initialize login | |
| @login = login |
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 'dm-core' | |
| require 'haml' | |
| DataMapper.setup(:default, 'sqlite3::memory:') | |
| class Message | |
| include DataMapper::Resource | |
| property :id, Serial |
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
| if request.xhr? | |
| # renders :template_partial without layout.html | |
| slim :template_partial, :layout => false | |
| else | |
| # renders as normal inside layout.html | |
| slim :template_partial | |
| 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
| # Place this file inside your ~/.idlerc/ folder | |
| # or paste its contents inside | |
| # /path/to/python/idlelib/config-highlight.def | |
| # Adapted from SublimeText's Monokai | |
| [monokai] | |
| normal-foreground= #F8F8F2 | |
| normal-background= #272822 | |
| keyword-foreground= #F92672 | |
| keyword-background= #272822 |
NewerOlder