TLDR: Use for...of instead of forEach() in asynchronous code.
For legacy browsers, use for(...;...;...) or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
| -- Turkce isimler sozlugu twitter : http://twitter.com/baskindev | |
| CREATE TABLE `isimler` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `isimler` varchar(255) DEFAULT NULL, | |
| `cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U', | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB; | |
| -- ---------------------------- |
| /** | |
| * Настройка столбцов списка элементов ИБ в админке инфоблоков | |
| * | |
| * @param integer $IBlockID — ID инфоблока | |
| * @param string $arIBlockListAdminColumns — символьные коды полей и свойств для показа в списке элементов ИБ | |
| * @param string $orderByColumnName — наименования поля или свойства по которому нудно отсортировать | |
| * @param string $orderDirection - направление сортировки | |
| * @param integer $pageSize - количество элементов на страницу | |
| * @param boolean $isToAllUsers - значение будет для всех, или для текущего пользователя | |
| * @return boolean |
| <?php | |
| // Does string contain letters? | |
| function _s_has_letters( $string ) { | |
| return preg_match( '/[a-zA-Z]/', $string ); | |
| } | |
| // Does string contain numbers? | |
| function _s_has_numbers( $string ) { | |
| return preg_match( '/\d/', $string ); |
| /** | |
| * Copy of Excel's PMT function. | |
| * Credit: http://stackoverflow.com/questions/2094967/excel-pmt-function-in-js | |
| * | |
| * @param rate_per_period The interest rate for the loan. | |
| * @param number_of_payments The total number of payments for the loan in months. | |
| * @param present_value The present value, or the total amount that a series of future payments is worth now; | |
| * Also known as the principal. | |
| * @param future_value The future value, or a cash balance you want to attain after the last payment is made. | |
| * If fv is omitted, it is assumed to be 0 (zero), that is, the future value of a loan is 0. |
| <? | |
| $res = CIBlockSection::GetList( | |
| Array('name' => 'asc'), | |
| Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y') | |
| ); | |
| while ($row = $res->GetNext()) | |
| { | |
| echo $row['NAME'].'<br>'; | |
| $rsParentSection = CIBlockSection::GetByID($row['ID']); | |
| if ($arParentSection = $rsParentSection->GetNext()) |
| I use the first | |
| —– BEGIN LICENSE —– | |
| Michael Barnes | |
| Single User License | |
| EA7E-821385 | |
| 8A353C41 872A0D5C DF9B2950 AFF6F667 | |
| C458EA6D 8EA3C286 98D1D650 131A97AB | |
| AA919AEC EF20E143 B361B1E7 4C8B7F04 |
| <div id="my_container"></div> <!-- Form container --> | |
| <!-- JS code from CRM Bitrix24 --> | |
| <!-- Added "node" parametr --> | |
| <script id="bx24_form_inline" data-skip-moving="true"> | |
| (function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u; | |
| (w[b].forms=w[b].forms||[]).push(arguments[0])}; | |
| if(w[b]['forms']) return; | |
| s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r; | |
| h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h); | |
| })(window,document,'http://cp.silaev.bx/bitrix/js/crm/form_loader.js','b24form'); |
| # Select one of the following options - Security decreases from top to bottom. | |
| Header append X-FRAME-OPTIONS "DENY" | |
| Header append X-FRAME-OPTIONS "SAMEORIGIN" | |
| Header append X-FRAME-OPTIONS "ALLOW-FROM https://example.com/" |
| <!-- Goes into viewer.html just before ending </body> --> | |
| <script> | |
| let pinchZoomEnabled = false; | |
| function enablePinchZoom(pdfViewer) { | |
| let startX = 0, startY = 0; | |
| let initialPinchDistance = 0; | |
| let pinchScale = 1; | |
| const viewer = document.getElementById("viewer"); | |
| const container = document.getElementById("viewerContainer"); | |
| const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; }; |