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
# See https://github.com/justin808/justin808-dotfiles/blob/master/home/.pryrc | |
# Using these pry gems | |
# Essentials | |
# gem "pry" | |
# gem "pry-rails" | |
# gem "pry-byebug" | |
# gem "pry-doc" | |
# gem "pry-rescue" | |
# If you like this one: |
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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
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
{ | |
"auto_indent": true, | |
"color_scheme": "Packages/Color Scheme - Default/Mariana.sublime-color-scheme", | |
"detect_indentation": true, | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_face": "Fira Code", | |
"font_size": 14, | |
"ignored_packages": | |
[ |
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
# using these pry gems | |
# gem "pry" | |
# gem "pry-rails" | |
# gem "pry-byebug" | |
# gem "pry-stack_explorer" | |
# gem "pry-doc" | |
# gem "pry-state" | |
# gem "pry-toys" | |
# gem "pry-rescue" |
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
{ | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme", | |
"draw_white_space": "all", | |
"trim_trailing_white_space_on_save": true, | |
"ensure_newline_at_eof_on_save": true, | |
"translate_tabs_to_spaces": true, | |
"detect_indentation": true, | |
"auto_indent": true, | |
"font_face": "Firacode", | |
"font_size": 11, |
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
# 1) What is your favorite Ruby class/library or method and why? | |
# I like ruby structure at all. It is intuitive understandability of its methods and language reads as plain english. | |
# I started using ruby for linux administration and writing scripts on ruby, so my favourite class is 'File', I like its for convenient methods for working with filesystem. | |
# Of course also array and hash classes, because simply a pleasure to work with objects of these classes. | |
# As for method - maybe reduce, because it allows to do complex things by a simple logic and allows do not make a big hardreading constructions. | |
# Also I like a lot of methods for working with hashes and arrays for their simplicity and clarity. | |
# Before ruby, I had experience with Java and C#, and now I'm glad that I'm working with ruby. | |
----- |
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
# BasketsController < ApplicationController | |
class BasketController | |
# всё сразу в одном методе | |
def add_to_basket | |
# могут быть одинаковые названия, поэтому искать лучше по id товара | |
item = Item.find_by_title(params[:item_title]) | |
# непонятно зачем глобальная переменная |
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
# BasketsController < ApplicationController | |
class BasketController | |
# всё сразу в одном методе | |
def add_to_basket | |
# могут быть одинаковые названия, поэтому искать лучше по id товара | |
item = Item.find_by_title(params[:item_title]) | |
# непонятно зачем глобальная переменная |
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 'telegram/bot' | |
require 'open-uri' | |
require 'net/http' | |
require 'uri' | |
token = 'kakoy-to token' | |
KRAEV = ['Краев мой друг', 'Серега - отличный парень', 'Люблю Краева', | |
'Без Сережки чата не станет'].freeze | |
DIMA = ["Дима самый лучший", "Серов - душа компании", "Дима самый умный, хоть и дурак", |
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
factory :rubric do | |
title 'rubric' | |
content 'rubric_content' | |
trait :rubric1 do | |
title 'rubric1' | |
content 'rubric1' | |
end | |
trait :rubric2 do |
NewerOlder