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
file_data = File.read(ARGV[0]) | |
mapping_regex = /^[ ]+?JSON\.mapping\(\{?$\n(^.+?,?$\n)+?\s+\}?\)/m | |
file_data.gsub!(mapping_regex) do |match| | |
result = '' | |
lines = match.split("\n") | |
lines.each.with_index do |line, i| | |
if i.zero? | |
result << line.sub(/JSON\.mapping\(\{?/, 'include JSON::Serializable') + "\n\n" |
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
#!/usr/bin/env ruby | |
require 'slop' | |
VERSION = '1.0.1' | |
OPT = Slop.parse do |o| | |
o.separator 'Data streams:' | |
o.string '-i', '--input', 'path to input file. If "pipe:0" is specified, STDIN will be used', required: false | |
o.string '-o', '--output', 'path to output file. If "pipe:1" is specified STDOUT will be used', required: false |
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
/* | |
Инструкция по использованию: | |
- Заходим в раздел с аудиозаписями | |
- Листаем в самый низ (Чтобы прогрузились все аудиозаписи) (Можно зажать клавишу PageDown) | |
- Открываем консоль браузера (F12 -> Консоль) | |
- Вставляем код и нажимаем Enter | |
- Скачивание началось... | |
- Браузер может потребовать разрешение на сохранение файлов, необходимо подтвердить действие | |
- Оставляем браузер на время прямо пропорциональное количеству аудиозаписей :) |