const { GoogleSpreadsheet } = require('google-spreadsheet');
const apiKey = API_KEY; // Ключ для работы с Google SpreadSheet API
const findId = "234567"; // Искомый номер
const spreadSheetId = "1PWuqvPkqB7gFEe1l7vXOvWdFkqbNAN6IsbP_9gUM1mE"; // ID таблицы в гуглодоках
(async () => {
const doc = new GoogleSpreadsheet(spreadSheetId );
await doc.useApiKey(apiKey);
await doc.loadInfo();
const sheet = doc.sheetsByIndex[0];
const rows = await sheet.getRows();
const point = rows.find(row => row._rawData[0] == findId)._rawData[1];
console.log(point);
})();
<html lang="ru">
...
<p lang="ru">Текст на русском</p>
<p lang="en">English text</p>
...
html[lang="ru"] [lang="en"] {
display: none;
}
html[lang="en"] [lang="ru"] {
display: none;
}
<ul class="langswitcher">
<li class="active"><a href="#ru" data-lang="ru">Ru</a></li>
<li><a href="#en" data-lang="en">En</a></li>
</ul>
$(".langswitcher a").on("click",function(e){
e.preventDefault();
$(".langswitcher li").removeClass("active");
$("html").attr("lang",$(this).data("lang"));
$(this).parent().addClass("active");
});
ini_set('default_socket_timeout', 10);
$options = stream_context_create([
'http' =>
[
'timeout' => 10
]
]);
$content = file_get_contents('http://example.com', false, $options);
class CalculationData;
abstract class Calculation
{
public function calculate(CalculationData data);
}
class CalculationQueue
{
public function addCalculation(Calculation calculationVariant, int priority);
public function calculate(CalculationData data) {
for (c in calculations) {
if(res = c.calculate(data)) return res;
}
}
}
protected $casts = [
'created_at' => 'datetime:d/m/Y', // Свой формат
'updated_at' => 'datetime:d/m/Y',
];