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
module TimeSlice | |
def self.time_slice(slice) | |
bgntime = Time.now | |
id = 0 | |
loop do | |
id=id+1 | |
puts "#{id} works" | |
# do your work here like above line | |
# and pass milliseconds for "slice" var |
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
Ruby | |
принципиальное различие скриптовых и “обычных” языков | |
3 принципа ООП | |
реализация множественного наследования в ruby | |
duck typing | |
многопоточность в ruby | |
Rails | |
что такое MVC и зачем это нужно | |
локига в контроллере, должна ли быть и почему | |
синхронные и асинхронные операции — предложить варианты решения |
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
curl -XPUT 'http://localhost:9200/_settings' -d ' | |
{ | |
"index" : { | |
"number_of_replicas" : 0 | |
} | |
}' |
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
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: ruby:2.3.3-alpine | |
working_directory: /home/circleci/masutaka.net | |
steps: | |
- setup_remote_docker: | |
# https://circleci.com/docs/2.0/docker-layer-caching/ | |
reusable: true |
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
module Types | |
include Dry::Types.module | |
Numbers = Types::Array.constructor do |elements| | |
elements ? elements.reject(&:blank?).map(&:to_i) : elements | |
end | |
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
outer_schema = ::Dry::Validation.Schema(::Dry::Validation::Schema::Params) do | |
required(:announcement).filled(:str?) | |
required(:title).filled(:str?) | |
end | |
schema(outer_schema: outer_schema) |
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
class Someresource < ApplicationRecord | |
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
ActiveAdmin.register SomeResource do | |
permit_params :title, :announcement | |
schema do | |
required(:announcement).filled(:str?) | |
required(:title).filled(:str?) | |
end | |
form do |f| | |
f.semantic_errors(*f.object.errors.keys) |
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
let(:account) { create(:account) } | |
let(:project) { create(:project, account: account) } | |
let(:task) { create(:task, project: project, account: account) } |
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 :account do | |
end | |
factory :user do | |
account | |
end | |
factory :project do | |
account | |
user |
NewerOlder