Compare commits

...

2 Commits

Author SHA1 Message Date
4f72bea6f4
move js 2022-10-08 00:32:03 +03:00
dfb33eb783
crystal fiber's 2022-10-08 00:31:44 +03:00
3 changed files with 28 additions and 9 deletions

View File

@ -30,6 +30,15 @@ indent_size = 2
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
# JavaScript
[*.js]
indent_style = space
indent_size = 2
[package.json]
indent_style = space
indent_size = 2
# Web Sites # Web Sites
[{*.html,*.css,*.json}] [{*.html,*.css,*.json}]
indent_style = tab indent_style = tab
@ -52,15 +61,6 @@ indent_size = 4
indent_style = tab indent_style = tab
indent_size = 4 indent_size = 4
# JavaScript
[*.js]
indent_style = space
indent_size = 2
[package.json]
indent_style = space
indent_size = 2
## for this repo ## for this repo
[~/SSH/config] [~/SSH/config]
indent_style = tab indent_style = tab

View File

@ -6,6 +6,7 @@
- [ENV["..."]](env_variable.cr) - Переменные среды - [ENV["..."]](env_variable.cr) - Переменные среды
- [Colorize](Colorize.cr) - Цветной вывод в консоль - [Colorize](Colorize.cr) - Цветной вывод в консоль
- [JSON](json.cr) - Пример работы с JSON - [JSON](json.cr) - Пример работы с JSON
- [Fiber](schedule.cr) - Пример распаралеливания кода и расписания
## Stuff ## Stuff
- [`irc_bot.cr`](irc_bot.cr) - Реализация клиента (бота) для IRC - [`irc_bot.cr`](irc_bot.cr) - Реализация клиента (бота) для IRC

18
~/Crystal/schedule.cr Normal file
View File

@ -0,0 +1,18 @@
def every(period : Time::Span, &block : -> T) forall T
spawn do
loop do
block.call
sleep period
end
end
end
every(2.seconds) {
puts "-@-@-"
}
every(4.seconds) {
puts "(-.-)Zzz..."
}
sleep