a = [
'hash',
'array',
[
'map',
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 SingleConfiguration | |
def initialize(raw_configuration) | |
@adjacency_matrix = [ [], [] ] | |
@city_names = [] | |
parse_configuration(raw_configuration) |
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
proc and lambda? | |
yield | |
1. your own class as a key in hesh. listen carefully. | |
2. send(:momom) | |
3. | |
See http://ruby-doc.org/core/classes/Hash.html |
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 LibraryItem | |
module Initializer | |
def initialize *args | |
@@group_identifier ||= 0 | |
@identifier = @@group_identifier += 1 | |
super *args | |
end | |
end | |
module ClassMethods |
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
$ bundle exec irb | |
Invalid gemspec in [/home/petro/.rvm/gems/ree-1.8.7-2012.02/specifications/ZenTest-4.11.0.gemspec]: Illformed requirement ["< 3.0, >= 1.8"] | |
Invalid gemspec in [/home/petro/.rvm/gems/ree-1.8.7-2012.02/specifications/ZenTest-4.11.0.gemspec]: Illformed requirement ["< 3.0, >= 1.8"] | |
Invalid gemspec in [/home/petro/.rvm/gems/ree-1.8.7-2012.02/specifications/ZenTest-4.11.0.gemspec]: Illformed requirement ["< 3.0, >= 1.8"] | |
ree-1.8.7-2012.02 :001 > require 'mongomatic' | |
** Notice: The native BSON extension was not loaded. ** | |
For optimal performance, use of the BSON extension is recommended. | |
To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set |
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:\Users\Thot\Documents\GitHub> cd .\recursion | |
C:\Users\Thot\Documents\GitHub\recursion [master]> git status | |
On branch master | |
Your branch is up-to-date with 'origin/master'. | |
nothing to commit, working directory clean | |
C:\Users\Thot\Documents\GitHub\recursion [master]> git status | |
On branch master | |
Your branch is up-to-date with 'origin/master'. | |
nothing to commit, working directory clean | |
C:\Users\Thot\Documents\GitHub\recursion [master]> git status |
Планування - одна з непростих речей, і практика тут зайвою не буває. Крім того, є можливість попрактикувати html, git, хто бажає - може робити css та js.
- Створити сторінку на github pages - отут є інструкція https://pages.github.com/
- Писати туди про планований матеріал для опрацювання. Будь що: стаття, відео, розділ книги - що займе 20 хвилин або більше.
Написати функцію, що приймає параметри: одномірний масив рядків, конкретний елемент з цього масиву, індекс у вигляді массиву інтеджерів
Функція має вертати масив довільної (випадково згенерованої від 1 до 100, але не менше ніж задана третім параметром) розмірності, що обов’язково містить заданий елемент по заданому індексу. Також в масиві повинні обов’язково бути присутні всі елементи з першого параметру. Решта елементів - мають бути випадково згенерованими стрінгами.
def generate_array(arr, element, complex_index)
# your code here
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 'resque-loner' | |
class Jobs::Base | |
include Resque::Plugins::UniqueJob | |
@queue = :small_queue | |
class << self | |
def uniq?(*args) | |
@arguments = args | |
!already_working? |
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
# code from Pull Request: | |
expect(some_great_arr.map { |i| i[:key_in_hash] }).to eq [8, 6, 3] | |
# code review comment from tech lead: | |
# `i` is not the best name for variable |
OlderNewer