-
require выражения
-
include выражения
-
определение классов и модулей
-
основная часть программы
-
код для тестирования
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
| iconv -f cp1251 -t utf-8 < file > file.new | |
| head -10 file | iconv -f cp1251 -t utf-8 |
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 Быт. 1, 2, 3 | |
| 2 Быт. 4, 5, 6, 7 | |
| 3 Быт. 8, 9, 10, 11 | |
| 4 Иов 1, 2, 3, 4, 5 | |
| 5 Иов 6, 7, 8, 9 |
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
| HANDY ONE-LINERS FOR RUBY November 16, 2005 | |
| compiled by David P Thomas <davidpthomas@gmail.com> version 1.0 | |
| Latest version of this file can be found at: | |
| http://www.fepus.net/ruby1line.txt | |
| Last Updated: Wed Nov 16 08:35:02 CST 2005 | |
| FILE SPACING: |
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
| // Looping a triangle | |
| // http://eloquentjavascript.net/2nd_edition/preview/02_program_structure.html | |
| var s = ''; | |
| for (var i=1;i<=7;i++){ | |
| s += '#'; | |
| console.log(s); | |
| } |
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
| for i in [1..100] | |
| console.log(['Fizz' if i % 3 is 0] + ['Buzz' if i % 5 is 0] or i) |
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
| for (var i=1; i<=100; i++) { | |
| var string = ''; | |
| if (i % 3 == 0) { | |
| string += 'Fizz'; | |
| } | |
| if (i % 5 == 0) { | |
| string += 'Buzz'; | |
| } |
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.upto(100) { |i| puts "#{[:Fizz][i%3]}#{[:Buzz][i%5]}"[/.+/m] || i } |
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
| for(i=0;i<100;console.log(++i%15?i%5?i%3?i:f='Fizz':b='Buzz':f+b)); |