add first Crystal snipplet
This commit is contained in:
parent
412eaf212e
commit
ea6d3e58a5
@ -1,6 +1,7 @@
|
|||||||
* [HTML](~/HTML/)
|
* [HTML](~/HTML/)
|
||||||
* [CSS](~/CSS/)
|
* [CSS](~/CSS/)
|
||||||
* [HTTP](~/HTTP/)
|
* [HTTP](~/HTTP/)
|
||||||
|
* [Crystal](~/Crystal/)
|
||||||
* [PHP](~/PHP/)
|
* [PHP](~/PHP/)
|
||||||
* [JavaScript](~/JavaScript/)
|
* [JavaScript](~/JavaScript/)
|
||||||
* [nginx](~/nginx/)
|
* [nginx](~/nginx/)
|
||||||
|
4
~/Crystal/README.md
Normal file
4
~/Crystal/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Crystal
|
||||||
|
|
||||||
|
## std
|
||||||
|
- [Значение из Regex::MatchData](value_from_match.cr) - Получить значение из `Regex::MatchData("Happy")`
|
8
~/Crystal/value_from_match.cr
Normal file
8
~/Crystal/value_from_match.cr
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
test_string_1 = "rw------- (0o600)"
|
||||||
|
# test_string_2 = "rwx------ (0o700)"
|
||||||
|
|
||||||
|
if /\d{3}/.match(test_string_1).try &.[0] != "600"
|
||||||
|
puts "Password file permissions is not RW for you.".colorize(:red)
|
||||||
|
|
||||||
|
exit(0)
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user